nclient / NClient

:dizzy: NClient is an automatic type-safe .Net HTTP client that allows you to call web service API methods using annotated interfaces or controllers without boilerplate code.
Apache License 2.0
43 stars 11 forks source link

Sending requests inside the handler #432

Open smolchanovsky opened 2 years ago

smolchanovsky commented 2 years ago

Sometimes it becomes necessary to send additional requests in the handler, for example, to process 4** response codes. Here is an example of how it can be used in the system HttpClient. It is necessary to make the same feature in the NClient.

A workaround that can be used now:

public void ConfigureServices(IServiceCollection services)
{
    services.AddRestNClient<IMyClient>()
        .AddHttpMessageHandler<AuthHeaderHandler>();
}

you can add HttpClient's system handlers.