Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Passing Correlation Id to subsequent request
public class Startup
{
public virtual void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient<IMyServiceClient, MyServiceClient>((serviceProvider, client) =>
{
client.BaseAddress = customerCoreServiceOptions.BaseUri;
client.DefaultRequestHeaders.Add("correlation-id",
CorrelationIdContext.GetCorrelationId() ??
Guid.NewGuid().ToString());
});
}
public void Configure(IApplicationBuilder app)
{
// Code removed for brevity
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment