Merge branch 'v1.14' into pubsub-raw-message

This commit is contained in:
Mark Fussell 2025-02-06 10:42:14 -08:00 committed by GitHub
commit 1154cc6855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 12 deletions

View File

@ -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);
``` ```