Table of Contents

Class HttpClientFactory

Namespace
Autodesk.Common.HttpClientLibrary
Assembly
Autodesk.Common.HttpClientLibrary.dll
public static class HttpClientFactory
Inheritance
HttpClientFactory
Inherited Members

Methods

Create((int maxRequests, TimeSpan? timeWindow), HttpMessageHandler?)

Creates a new HttpClient with an error handler and a decompression handler.

public static HttpClient Create((int maxRequests, TimeSpan? timeWindow) rateLimit = default, HttpMessageHandler? finalHandler = null)

Parameters

rateLimit (int maxRequests, TimeSpan? timeWindow)
finalHandler HttpMessageHandler

Optional: If set will replace the default error and decompression handlers

Returns

HttpClient

A new instance of Microsoft.Kiota.Http.HttpClientLibrary.KiotaClientFactory

CreateAdapter(Func<Task<string>>, HttpClient?)

Creates a new HttpClientRequestAdapter with an AccessTokenProvider. The adapter will use the default error and decompression handlers.

public static HttpClientRequestAdapter CreateAdapter(Func<Task<string>> getAccessToken, HttpClient? httpClient)

Parameters

getAccessToken Func<Task<string>>
httpClient HttpClient

Returns

HttpClientRequestAdapter

Request adapter for SDK client instances

GetDefaultHandlerTypes()

public static IList<Type> GetDefaultHandlerTypes()

Returns

IList<Type>