Skip to content

Commit 6b1b9fd

Browse files
committed
Update examples to use JsonApiClient
1 parent 67d022d commit 6b1b9fd

28 files changed

+35
-35
lines changed

MyApp/_includes/jwt-service-clients.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ automatically supports fetching new JWT Bearer Tokens & transparently Auto Retry
1111
#### C#, F# & VB .NET Service Clients
1212

1313
```csharp
14-
var client = new JsonServiceClient(baseUrl);
14+
var client = new JsonApiClient(baseUrl);
1515
var authRequest = new Authenticate {
1616
provider = "credentials",
1717
UserName = userName,

MyApp/_pages/advantages-of-message-based-web-services.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ But even without this, ServiceStack services are just as consumable as any other
230230
The earlier typed API example of creating a new TODO in C#:
231231

232232
```csharp
233-
var client = new JsonServiceClient(baseUrl);
233+
var client = new JsonApiClient(baseUrl);
234234
Todo createdTodo = client.Post(new Todo { Content = "New Todo", Order = 1 });
235235
```
236236

237237
Is like this in [TypeScript](/typescript-add-servicestack-reference):
238238

239239
```ts
240-
var client = new JsonServiceClient(baseUrl);
240+
var client = new JsonApiClient(baseUrl);
241241
var request = Todo();
242242
request.Content = "New Todo";
243243
request.Order = 1;

MyApp/_pages/api-design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public class Contact { ... }
338338
Which can used in any ServiceClient with:
339339

340340
```csharp
341-
var client = new JsonServiceClient(BaseUri);
341+
var client = new JsonApiClient(BaseUri);
342342
List<Contact> response = client.Get(new GetContacts());
343343
```
344344

@@ -351,7 +351,7 @@ can alternatively choose to use [Add ServiceStack Reference](/csharp-add-service
351351
alternative way to get the Services typed DTOs on the client. In both cases the exact same source code is used to call the Services:
352352

353353
```csharp
354-
var client = new JsonServiceClient(BaseUri);
354+
var client = new JsonApiClient(BaseUri);
355355
var response = client.Get(new GetContacts());
356356
```
357357

MyApp/_pages/auth/api-key-authprovider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ curl https://api.stripe.com/v1/charges -H "Authorization: Bearer yDOr26HsxyhpuRB
8787
Both of these methods are built into most HTTP Clients. Here are a few different ways which you can send them using ServiceStack's [.NET Service Clients](/csharp-client):
8888

8989
```csharp
90-
var client = new JsonServiceClient(baseUrl) {
90+
var client = new JsonApiClient(baseUrl) {
9191
Credentials = new NetworkCredential(apiKey, "")
9292
};
9393

MyApp/_pages/auth/auth-repository.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ More examples of this are in [ManageRolesTests.cs](https://github.com/ServiceSta
391391
Super Users with the **Admin** role or Requests with an [AdminAuthSecret](/debugging#authsecret) can call the built-in `/assignroles` and `/unassignroles` Services to add Roles/Permissions to existing users from an external Request, e.g:
392392

393393
```csharp
394-
var client = new JsonServiceClient(baseUrl);
394+
var client = new JsonApiClient(baseUrl);
395395
var response = client.Post(new AssignRoles
396396
{
397397
UserName = userName,

MyApp/_pages/auth/authentication-and-authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ On the client you can use the [C#/.NET Service Clients](/csharp-client) to easil
501501
To authenticate using your `CustomCredentialsAuthProvider` by POST'ing a `Authenticate` Request, e.g:
502502

503503
```csharp
504-
var client = new JsonServiceClient(BaseUrl);
504+
var client = new JsonApiClient(BaseUrl);
505505

506506
var authResponse = client.Post(new Authenticate {
507507
provider = CredentialsAuthProvider.Name, //= credentials

MyApp/_pages/auth/encrypted-messaging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ It's safer instead to download the public key over a trusted `https://` url wher
4848
Since `GetPublicKey` is just a ServiceStack Service it's easily downloadable using a Service Client:
4949

5050
```csharp
51-
var client = new JsonServiceClient(BaseUrl);
51+
var client = new JsonApiClient(BaseUrl);
5252
string publicKeyXml = client.Get(new GetPublicKey());
5353
```
5454

@@ -68,7 +68,7 @@ To help with verification the SHA256 Hash of the PublicKey is returned in `X-Pub
6868
Once they have the Server's Public Key, clients can use it to get an `EncryptedServiceClient` via the `GetEncryptedClient()` extension method on `JsonServiceClient` or new `JsonHttpClient`, e.g:
6969

7070
```csharp
71-
var client = new JsonServiceClient(BaseUrl);
71+
var client = new JsonApiClient(BaseUrl);
7272
IEncryptedClient encryptedClient = client.GetEncryptedClient(publicKeyXml);
7373
```
7474

MyApp/_pages/auth/identityserver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public async Task<IActionResult> CallServiceClient()
251251
{
252252
var accessToken = await HttpContext.GetTokenAsync("access_token");
253253

254-
var client = new JsonServiceClient("https://localhost:5001/") {
254+
var client = new JsonApiClient("https://localhost:5001/") {
255255
BearerToken = accessToken
256256
};
257257
var response = await client.GetAsync(new GetIdentity());

MyApp/_pages/auth/jwt-authprovider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The JWT Auth Provider defaults to `RequireSecureConnection=true` which mandates
117117
JWT Tokens can be sent using the Bearer Token support in all HTTP and Service Clients:
118118

119119
```csharp
120-
var client = new JsonServiceClient(baseUrl) {
120+
var client = new JsonApiClient(baseUrl) {
121121
BearerToken = jwtToken
122122
};
123123

MyApp/_pages/auto-batched-requests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Thanks to it's [message-based design](/advantages-of-message-based-web-services)
1414
This is enabled in all [.NET Service Clients](/csharp-client) via the new `SendAll()` and `SendAllOneWay()` API's, e.g:
1515

1616
```csharp
17-
var client = new JsonServiceClient(BaseUrl);
17+
var client = new JsonApiClient(BaseUrl);
1818
var requests = new[]
1919
{
2020
new Request { Id = 1, Name = "Foo" },

0 commit comments

Comments
 (0)