mirror of https://github.com/dapr/docs.git
Merge branch 'v1.14' into pubsub-raw-message
This commit is contained in:
commit
1154cc6855
|
@ -439,12 +439,10 @@ app.MapPost("/orders", (Order order) =>
|
||||||
In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
|
In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
var client = new HttpClient();
|
var client = DaprClient.CreateInvokeHttpClient(appId: "order-processor");
|
||||||
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
|
var cts = new CancellationTokenSource();
|
||||||
|
|
||||||
client.DefaultRequestHeaders.Add("dapr-app-id", "order-processor");
|
var response = await client.PostAsJsonAsync("/orders", order, cts.Token);
|
||||||
|
|
||||||
var response = await client.PostAsync($"{baseURL}/orders", content);
|
|
||||||
Console.WriteLine("Order passed: " + order);
|
Console.WriteLine("Order passed: " + order);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1089,12 +1087,10 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- dotnet r
|
||||||
In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
|
In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service.
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
var client = new HttpClient();
|
var client = DaprClient.CreateInvokeHttpClient(appId: "order-processor");
|
||||||
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
|
var cts = new CancellationTokenSource();
|
||||||
|
|
||||||
client.DefaultRequestHeaders.Add("dapr-app-id", "order-processor");
|
var response = await client.PostAsJsonAsync("/orders", order, cts.Token);
|
||||||
|
|
||||||
var response = await client.PostAsync($"{baseURL}/orders", content);
|
|
||||||
Console.WriteLine("Order passed: " + order);
|
Console.WriteLine("Order passed: " + order);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue