Git Product home page Git Product logo

apizr's Introduction

Apizr

Refit based web api client, but resilient (retry, connectivity, cache, auth, log, priority...)

Read - Documentation

What

The Apizr project was motivated by this 2015 famous blog post about resilient networking.

Its main focus was to address at least everything explained into this article, meanning:

  • Easy access to restful services
  • Work offline with cache management
  • Handle errors with retry pattern and global catching
  • Handle request priority
  • Check connectivity
  • Fast development time
  • Easy maintenance
  • Reuse existing libraries

But also, some more core features like:

  • Trace http traffic
  • Handle authentication

And more integration/extension independent optional features like:

  • Choose cache, log and connectivity providers
  • Register it as an MS DI extension
  • Map model with DTO
  • Use Mediator pattern
  • Use Optional pattern
  • Manage file transfers

The list is not exhaustive, there’s more, but what we wanted was playing with all of it with as less code as we could, not worrying about plumbing things and being sure everything is wired and handled by design or almost.

Inspired by Refit.Insane.PowerPack, we wanted to make it simple to use, mixing attribute decorations and fluent configuration.

Also, we built this lib to make it work with any .Net Standard 2.0 compliant platform, so we could use it seamlessly from any kind of app, with or without DI goodness.

How

An api definition with some attributes:

// (Polly) Define a resilience pipeline key
[assembly:ResiliencePipeline("TransientHttpError")]
namespace Apizr.Sample
{
    // (Apizr) Define your web api base url and ask for cache and logs
    [WebApi("https://reqres.in/"), Cache, Log]
    public interface IReqResService
    {
        // (Refit) Define your web api interface methods
        [Get("/api/users")]
        Task<UserList> GetUsersAsync();

        [Get("/api/users/{userId}")]
        Task<UserDetails> GetUserAsync([CacheKey] int userId);

        [Post("/api/users")]
        Task<User> CreateUser(User user);
    }
}

Some resilience strategies:

// (Polly) Create a resilience pipeline with some strategies
var resiliencePipelineBuilder = new ResiliencePipelineBuilder<HttpResponseMessage>()
    // Configure telemetry to get some logs from Polly process
    .ConfigureTelemetry(LoggerFactory.Create(loggingBuilder =>
        loggingBuilder.Debug()))
    // Add a retry strategy with some options
    .AddRetry(
        new RetryStrategyOptions<HttpResponseMessage>
        {
            ShouldHandle = new PredicateBuilder<HttpResponseMessage>()
                .Handle<HttpRequestException>()
                .HandleResult(response =>
                    response.StatusCode is >= HttpStatusCode.InternalServerError
                        or HttpStatusCode.RequestTimeout),
            Delay = TimeSpan.FromSeconds(1),
            MaxRetryAttempts = 3,
            UseJitter = true,
            BackoffType = DelayBackoffType.Exponential
        }));

An instance of this managed api:

Relies on static builder instantiation approach.

// (Polly) Add the resilience pipeline with its key to a registry
var resiliencePipelineRegistry = new ResiliencePipelineRegistry<string>();
resiliencePipelineRegistry.TryAddBuilder<HttpResponseMessage>("TransientHttpError", 
    (builder, _) => builder.AddPipeline(resiliencePipelineBuilder.Build()));

// (Apizr) Get your manager instance
var reqResManager = ApizrBuilder.Current.CreateManagerFor<IReqResService>(
    options => options
        // With a logger
        .WithLoggerFactory(LoggerFactory.Create(loggingBuilder =>
            loggingBuilder.Debug()))
        // With the defined resilience pipeline registry
        .WithResiliencePipelineRegistry(resiliencePipelineRegistry)
        // And with a cache handler
        .WithAkavacheCacheHandler());

Relies on IServiceCollection extension methods approach.

// (Logger) Configure logging the way you want, like
services.AddLogging(loggingBuilder => loggingBuilder.AddDebug());

// (Apizr) Add an Apizr manager for the defined api to your container
services.AddApizrManagerFor<IReqResService>(options => 
    // With a cache handler
    options.WithAkavacheCacheHandler());

// (Polly) Add the resilience pipeline with its key to your container
services.AddResiliencePipeline<string, HttpResponseMessage>("TransientHttpError",
    builder => builder.AddPipeline(resiliencePipelineBuilder.Build()));
...

// (Apizr) Get your manager instance the way you want, like
var reqResManager = serviceProvider.GetRequiredService<IApizrManager<IReqResService>>();

And then you're good to go:

var userList = await reqResManager.ExecuteAsync(api => api.GetUsersAsync());

This request will be managed with the defined resilience strategies, data cached and all logged.

Apizr has a lot more to offer, just read the doc!

Where

Change Log

Managing (Core)

Project Current Upcoming
Apizr NuGet NuGet Pre Release
Apizr.Extensions.Microsoft.DependencyInjection NuGet NuGet Pre Release

Caching

Project Current Upcoming
Apizr.Extensions.Microsoft.Caching NuGet NuGet Pre Release
Apizr.Integrations.Akavache NuGet NuGet Pre Release
Apizr.Integrations.MonkeyCache NuGet NuGet Pre Release

Handling

Project Current Upcoming
Apizr.Integrations.Fusillade NuGet NuGet Pre Release
Apizr.Integrations.MediatR NuGet NuGet Pre Release
Apizr.Integrations.Optional NuGet NuGet Pre Release

Mapping

Project Current Upcoming
Apizr.Integrations.AutoMapper NuGet NuGet Pre Release
Apizr.Integrations.Mapster NuGet NuGet Pre Release

Transferring

Project Current Upcoming
Apizr.Integrations.FileTransfer NuGet NuGet Pre Release
Apizr.Extensions.Microsoft.FileTransfer NuGet NuGet Pre Release
Apizr.Integrations.FileTransfer.MediatR NuGet NuGet Pre Release
Apizr.Integrations.FileTransfer.Optional NuGet NuGet Pre Release

Generating

Project Current Upcoming
Apizr.Tools.NSwag NuGet NuGet Pre Release

Install the NuGet reference package of your choice:

  • Apizr package comes with the static builder instantiation approach (which you can register in your DI container then)
  • Apizr.Extensions.Microsoft.DependencyInjection package extends your IServiceCollection with AddApizr, AddApizrFor and AddApizrCrudFor registration methods
  • Apizr.Extensions.Microsoft.Caching package brings an ICacheHandler method mapping implementation for MS Extensions Caching
  • Apizr.Integrations.Akavache package brings an ICacheHandler method mapping implementation for Akavache
  • Apizr.Integrations.MonkeyCache package brings an ICacheHandler method mapping implementation for MonkeyCache
  • Apizr.Integrations.Fusillade package enables request priority management using Fusillade
  • Apizr.Integrations.MediatR package enables request auto handling with mediation using MediatR
  • Apizr.Integrations.Optional package enables Optional result from mediation requests (requires MediatR integration) using Optional.Async
  • Apizr.Integrations.AutoMapper package enables data mapping using AutoMapper
  • Apizr.Integrations.Mapster package enables data mapping using Mapster- Apizr.Integrations.FileTransfer package enables file transfer management for static registration
  • Apizr.Extensions.Microsoft.FileTransfer package enables file transfer management for extended registration
  • Apizr.Integrations.FileTransfer.MediatR package enables file transfer management for mediation requests (requires MediatR integration and could work with Optional integration) using MediatR
  • Apizr.Integrations.FileTransfer.Optional package enables file transfer management for mediation requests with optional result (requires MediatR integration and could work with Optional integration) using Optional.Async

Install the NuGet .NET CLI Tool package if needed:

  • Apizr.Tools.NSwag package enables Apizr files generation by command lines (Models, Apis and Registrations) from an OpenApi/Swagger definition using NSwag

Apizr core package make use of well known nuget packages to make the magic appear:

Package Features
Refit Auto-implement web api interface and deal with HttpClient
Polly Apply some policies like Retry, CircuitBreaker, etc...
Microsoft.Extensions.Logging.Abstractions Delegate logging layer to MS Extensions Logging

It also comes with some handling interfaces to let you provide your own services for:

  • Caching with ICacheHandler, which comes with its default VoidCacheHandler (no cache), but also with:
    • InMemoryCacheHandler & DistributedCacheHandler: MS Extensions Caching methods mapping interface (Integration package referenced above), meaning you can provide any compatible caching engine
    • AkavacheCacheHandler: Akavache methods mapping interface (Integration package referenced above)
    • MonkeyCacheHandler: MonkeyCache methods mapping interface (Integration package referenced above)
  • Logging As Apizr relies on official MS ILogger interface, you may want to provide any compatible logging engine (built-in DebugLogger activated by default)
  • Connectivity with IConnectivityHandler, which comes with its default VoidConnectivityHandler (no connectivity check)
  • Mapping with IMappingHandler, which comes with its default VoidMappingHandler (no mapping conversion), but also with:
    • AutoMapperMappingHandler: AutoMapper mapping methods mapping interface (Integration package referenced above)
    • MapsterMappingHandler: Mapster mapping methods mapping interface (Integration package referenced above)

apizr's People

Contributors

clement-cdy avatar jeremybp avatar robgibbens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

apizr's Issues

Android crashes after "set to SDK and user assembly"

Hi,JeremyBP !

I used apizr for production builds in my xamarin ,when linker setting: "AndroidLinkMode = SdkOnly" , an error occurred at runtime。

called ArgumentException --> services.UseApizrFor();

System.ArgumentException: 'Your Apizr manager class must inherit from IApizrManager generic interface or derived'

I think the apizr assembly should be removed by linker,do you provide preserve attribute , or falseflag to solve the issue ?

[External - Prism.DryIoc.Extensions] Authenticationhandler can only work on the last registered item???

I have defined three interfaces, as follows:

[Policy("TransientHttpError")]
[WebApi(GlobalSettings.BaseEndpoint + "api/v3/dcms/news", isAutoRegistrable: false), Trace]
public interface INewsApi
{
[Get("/topnews/0/6")]
[Headers("Authorization: Bearer")]
Task<APIResult<IList>> GetTopNewsAsync([CacheKey] int storeId, CancellationToken calToken = default);
}

[WebApi(GlobalSettings.BaseEndpoint + "api/v3/dcms/auth/user", isAutoRegistrable: false), Trace]
public interface IAuthorizationApi
{
[Get("/bearer/{store}/{userid}")]
[Headers("Authorization: Bearer")]
Task AuthBearerAsync(int store, int userid);
}

Register as follows in Startup : PrismStartup

//(1)
services.UseApizrFor(ob => ob
.WithHttpTracing(HttpTracer.HttpMessageParts.All)
.WithCacheHandler()
.WithAuthenticationHandler(settings => settings.Token, OnRefreshToken));

//(2)
services.UseApizrFor(ob => ob
.WithHttpTracing(HttpTracer.HttpMessageParts.All)
.WithCacheHandler()
.WithAuthenticationHandler(settings => settings.Token, OnRefreshToken));

Test case as follows:

//Test
var newsServie = Shiny.ShinyHost.Resolve<IApizrManager>();
var news = await newsServie.ExecuteAsync((ct, api) => api.GetTopNewsAsync(Settings.StoreId, ct), CancellationToken.None);
// 401 Unauthorized!!

var _httpBinManager = Shiny.ShinyHost.Resolve<IApizrManager>();
var response = await _httpBinManager?.ExecuteAsync(api => api.AuthBearerAsync(Settings.StoreId, Settings.UserId)) as HttpResponseMessage;
// 200 Ok!!

When I change the order of 1 and 2, the 1 available request succeeds and 2 fails

//Test
var newsServie = Shiny.ShinyHost.Resolve<IApizrManager>();
var news = await newsServie.ExecuteAsync((ct, api) => api.GetTopNewsAsync(Settings.StoreId, ct), CancellationToken.None);
// 200 Ok!!

var _httpBinManager = Shiny.ShinyHost.Resolve<IApizrManager>();
var response = await _httpBinManager?.ExecuteAsync(api => api.AuthBearerAsync(Settings.StoreId, Settings.UserId)) as HttpResponseMessage;
// 401 Unauthorized!!

????? I need your help. Thank you very much!!!

[question] how to invalidate cache for a specific request?

I did myself my fork of the "insane" pack, but I must say you did a terrific job here and I would like to stop using my fork and start using your implementation :)
The only thing I couldn't find in the docs is the possibility to invalidate the cache of a request. In my fork I added a Boolean on each request to invalidate the cache (force a remote fetch).
This particularly important when you are doing a pull 2 refresh on mobile.
So, am I missing something or are you accepting PRs :) ?

[External - Refit/Fusillade] Cannot access a disposed object. Object name: 'System.Net.Http.HttpConnection+HttpConnectionResponseContent'.

Hi, @JeremyBP ,I use Apizr 1.9.0,I have an API request "GetPermissionRecordSettingAsync",when I try to send the same content twice (in case of timeout or similar), I get an "ObjectDisposedException" as follows:

[Get("/auth/user/permission/{userId}")] Task<APIResult<IList<PermissionRecordQuery>>> GetPermissionRecordSettingAsync([CacheKey] int store, int userId, CancellationToken calToken = default);

"exception": { "type": "Apizr.ApizrException1[[DCMS.Client.Services.APIResult1[[System.Collections.Generic.IList1[[DCMS.Client.Models.Users.PermissionRecordQuery, DCMS.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], DCMS.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null]]",
"message": "Cannot access a disposed object.\nObject name: 'System.Net.Http.HttpConnection+HttpConnectionResponseContent'.",
"stackTrace": " at Apizr.ApizrManager1[TWebApi].ExecuteAsync[TResult] (System.Linq.Expressions.Expression1[TDelegate] executeApiMethod, System.Threading.CancellationToken cancellationToken, Fusillade.Priority priority) [0x005e4] in :0 \n at DCMS.Client.Services.UserService.GetPermissionRecordSettingAsync (System.Action1[T] action, System.Threading.CancellationTokenSource cts) [0x0013c] in <c6379d2ab81547ef80e263b722f90018>:0 ", "innerExceptions": [ { "type": "System.ObjectDisposedException", "message": "Cannot access a disposed object.\nObject name: 'System.Net.Http.HttpConnection+HttpConnectionResponseContent'.", "stackTrace": " at System.Net.Http.HttpContent.CheckDisposed () [0x00013] in <92d3ef97a77047c9ab125ae979975a02>:0 \n at System.Net.Http.HttpContent.ReadAsStreamAsync () [0x00000] in <92d3ef97a77047c9ab125ae979975a02>:0 \n at Refit.NewtonsoftJsonContentSerializer.DeserializeAsync[T] (System.Net.Http.HttpContent content) [0x00027] in <ea3d892ff3f046868a691cc71dcbabbf>:0 \n at Refit.RequestBuilderImplementation.DeserializeContentAsync[T] (System.Net.Http.HttpResponseMessage resp, System.Net.Http.HttpContent content) [0x002d5] in <ea3d892ff3f046868a691cc71dcbabbf>:0 \n at Refit.RequestBuilderImplementation+<>c__DisplayClass14_02[T,TBody].b__0 (System.Net.Http.HttpClient client, System.Threading.CancellationToken ct, System.Object[] paramList) [0x003a5] in :0 \n at Apizr.ApizrManager1[TWebApi].ExecuteAsync[TResult] (System.Linq.Expressions.Expression1[TDelegate] executeApiMethod, System.Threading.CancellationToken cancellationToken, Fusillade.Priority priority) [0x00528] in :0 ",
"wrapperSdkName": "appcenter.xamarin"
}
],
"wrapperSdkName": "appcenter.xamarin"
}`

Caching not working properly not respecting CacheKey

I have setup Caching as follows:

    [Post("/site/SRConsAPI?method=getSingleSignOnToken"), Cache(CacheMode.GetOrFetch, "00:30:00")]
    Task<singleSignOnTokenResult> GetSingleSignOnTokenAsync(
        [AliasAs("cons_id"), CacheKey] string constituentId);

Issue is when the constituentId parameter changes, the cached value based on the previous constituentId is returned.

I think the issue may arise here:

https://github.com/Respawnsive/Apizr/blob/078b3f987cd1a469645b2e7f855b5390c082f84e/Apizr/Src/Apizr/ApizrManager.cs#L2171C52-L2171C69

where this code returns without considering the [CacheKey].

           // Did we ask for it already ?
              if (_cachingMethodsSet.TryGetValue(methodToCacheData, out var methodCacheDetails))
              {
                  // Yes we did so get saved specific details
                  cacheAttribute = methodCacheDetails.cacheAttribute;
                  cacheKey = methodCacheDetails.cacheKey;

                  return cacheAttribute != null && !string.IsNullOrWhiteSpace(cacheKey);
              }

Here is a some client pseudo-code that will fail:

var singleSignOnTokenResult1 =
            await _apizrManager.ExecuteAsync(api => api.GetSingleSignOnTokenAsync("blah1"));

  var singleSignOnTokenResult2 =
            await _apizrManager.ExecuteAsync(api => api.GetSingleSignOnTokenAsync("blah2"));

singleSignOnTokenResult2 equals singleSignOnTokenResult1 as its not considering the passed in argument and hence pulls the cached value from the first call.

Here is a PR which may fix the issue: #21, but consider getting rid of _cachingMethodsSet too.

Authentication Handler logs too much

Hello,

I have an API that is called every few seconds and the log is full of these messages:

[Apizr - AuthenticationHandler`2: Authorization required with scheme Bearer] 
[Apizr - AuthenticationHandler`2: Saved token will be used] 
[Apizr - AuthenticationHandler`2: Authorization header has been set] 
[Apizr - AuthenticationHandler`2: Sending request with authorization header...] 
[Apizr - AuthenticationHandler`2: Token saved] 

Can the spots where the logger is called at least be guarded by if (apizrVerbosity >= ApizrLogLevel.Low)?

thanks

DistributedCacheHandler throws exception when CacheType = string as it doesn't handle null's properly

The following code:

services.AddApizrManagerFor<IBlackbaudSrApi>(optionsBuilder =>
          optionsBuilder
              .WithRefitSettings(new RefitSettings { ContentSerializer = new XmlContentSerializer() })
              .WithBaseAddress(sp =>
              {
                  var config = sp.GetService<BlackbaudConfiguration>();
                  return new UriBuilder(config.Header.RootUrl).Uri;
              })
              .AddDelegatingHandler<BlackbaudMessageSrHandler>(sp => sp.GetService<BlackbaudMessageSrHandler>())
              // .WithAkavacheCacheHandler()
              .WithCacheHandler<DistributedCacheHandler<string>>()
              .WithLogging());

      services.AddDistributedMemoryCache();

results in the following exception:

System.ArgumentNullException : Value cannot be null. (Parameter 'content')
   at System.ArgumentNullException.Throw(String paramName)
   at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
   at System.Net.Http.StringContent.GetContentByteArray(String content, Encoding encoding)
   at System.Net.Http.StringContent..ctor(String content, Encoding encoding, String mediaType)
   at Apizr.SerializationExtensions.FromJsonStringAsync[T](String str, IHttpContentSerializer contentSerializer, CancellationToken cancellationToken)
   at Apizr.DistributedCacheHandler`1.GetAsync[TData](String key, CancellationToken cancellationToken)
   at Apizr.ApizrManager`1.ExecuteAsync[TApiData](Expression`1 executeApiMethod, Action`1 optionsBuilder)

I think the fix is:

https://github.com/Respawnsive/Apizr/blob/master/Apizr/Src/Caching/Apizr.Extensions.Microsoft.Caching/SerializationExtensions.cs#L45


internal static async Task<T> FromJsonStringAsync<T>(this string str, IHttpContentSerializer contentSerializer, CancellationToken cancellationToken = default)
    {
        //todo: add this null protection
        if (str == null)
        {
            return default;
        }

        var content = new StringContent(str, Encoding.UTF8, "application/json");
        return await contentSerializer.FromHttpContentAsync<T>(content, cancellationToken);
    }

[Shiny] Compatibility issues with Shiny v2.0+

Shiny v2.0 removed built in caching feature. It also introduced a reshaped logging feature relying on Microsoft.Extensions.Logging.

Workaround: Don't call .UseWhatever(...) from Shiny intergration package anymore but .AddWhatever(...) instead and set options fluently like caching and logging providers.

Fix: I'm working on a new release relying on Microsoft.Extensions.Logging.Abstraction to get things less specific/more generic, just like Shiny does. Caching feature should now be activated fluently with the provider of your choice (e.g. MonkeyCache or Akavache).

Exception when Fusillade priority management is enabled with Prism.Magician

Exception:
Apizr may throw this exception when using Prism.Magician with Fusillade priority management activated: The 'InnerHandler' property must be null. 'DelegatingHandler' instances provided to 'HttpMessageHandlerBuilder' must not be reused or cached.
Handler: 'Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler'

Workaround
Turn it off with the WebApi attribute while waiting for a fix or if you do need/want to play with it, change from Prism.Magician to the Prism.Container.Extensions approach.

Actually, I'm thinking about outsourcing Fusillade and Polly from Apizr core package to Apizr.Integrations packages to get something fully modular.

Spontaneous Crash on iOS with DelegatingHandler

Hi,

we are getting spontaneous crashes on iOS if we are using our custom DelegatingHandler. Sometimes the app is working for couple of minutes/api calls without crash and then it crashes. There is not relevant exception for this, just a SIGABRT Crash from iOS. If we hard-code our api key in the delegatinghandler, the app is working fine. Is there some misconfiguration on our side? Or is there better way to do this? Thanks.

Versions:
Maui: 8.0.40 (happens in every Maui 8> version)
Apizr: 5.4.0
Shiny.Framework: 4.1.0
Prism.DryIoc.Maui: 9.0.401-pre

Registration in Maui:

builder.Services.AddApizr(apizrRegistry => apizrRegistry .AddManagerFor<IImpressumApi>() apizrExtendedCommonOptionsBuilder => apizrExtendedCommonOptionsBuilder .WithBaseAddress(builder.Configuration.GetValue<Uri>("BaseUrl")) .AddDelegatingHandler((provider) => new XApiKeyAuthenticationHandler(provider.GetRequiredService<ISecureStorage>())) .WithAkavacheCacheHandler() .WithExCatching(OnException, letThrowOnExceptionWithEmptyCache: false) .WithLogging( #if DEBUG HttpTracerMode.Everything, HttpMessageParts.All, LogLevel.Trace, LogLevel.Information, LogLevel.Critical #else HttpTracerMode.ExceptionsOnly, HttpMessageParts.ResponseAll, Microsoft.Extensions.Logging.LogLevel.Trace, Microsoft.Extensions.Logging.LogLevel.Information, Microsoft.Extensions.Logging.LogLevel.Critical #endif ) .WithConnectivityHandler<IConnectivity>(connectivity => connectivity.NetworkAccess == NetworkAccess.Internet));

DelegatingHandler:

`public class XApiKeyAuthenticationHandler : DelegatingHandler
{
public XApiKeyAuthenticationHandler(ISecureStorage secureStorage) : this(secureStorage, new HttpClientHandler())
{
}

public XApiKeyAuthenticationHandler(ISecureStorage secureStorage, HttpMessageHandler innerHandler)  : base(innerHandler)
{
    SecureStorage = secureStorage;
}

protected ISecureStorage SecureStorage { get; }

protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
    CancellationToken cancellationToken)
{
    var identityKey = await SecureStorage.GetAsync(AppConstants.IdentityKey);
    if (!string.IsNullOrWhiteSpace(identityKey))
    {
        request.Headers.Add("X-Identity-Key", identityKey);
    }

    return await base.SendAsync(request, cancellationToken);
}

}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.