GraphClientFactory.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Create(IAuthenticationProvider, String, String, IWebProxy, HttpMessageHandler) |
Creates a new HttpClient instance configured with the handlers provided. |
Create(IEnumerable<DelegatingHandler>, String, String, IWebProxy, HttpMessageHandler) |
Creates a new HttpClient instance configured with the handlers provided. |
Create(IAuthenticationProvider, String, String, IWebProxy, HttpMessageHandler)
Creates a new HttpClient instance configured with the handlers provided.
public static System.Net.Http.HttpClient Create (Microsoft.Graph.IAuthenticationProvider authenticationProvider, string version = "v1.0", string nationalCloud = "Global", System.Net.IWebProxy proxy = default, System.Net.Http.HttpMessageHandler finalHandler = default);
static member Create : Microsoft.Graph.IAuthenticationProvider * string * string * System.Net.IWebProxy * System.Net.Http.HttpMessageHandler -> System.Net.Http.HttpClient
Public Shared Function Create (authenticationProvider As IAuthenticationProvider, Optional version As String = "v1.0", Optional nationalCloud As String = "Global", Optional proxy As IWebProxy = Nothing, Optional finalHandler As HttpMessageHandler = Nothing) As HttpClient
Parameters
- authenticationProvider
- IAuthenticationProvider
The IAuthenticationProvider to authenticate requests.
- version
- String
The graph version to use.
- nationalCloud
- String
The national cloud endpoint to use.
- proxy
- IWebProxy
The proxy to be used with created client.
- finalHandler
- HttpMessageHandler
The last HttpMessageHandler to HTTP calls. The default implementation creates a new instance of HttpClientHandler for each HttpClient.
Returns
Applies to
Create(IEnumerable<DelegatingHandler>, String, String, IWebProxy, HttpMessageHandler)
Creates a new HttpClient instance configured with the handlers provided.
public static System.Net.Http.HttpClient Create (System.Collections.Generic.IEnumerable<System.Net.Http.DelegatingHandler> handlers, string version = "v1.0", string nationalCloud = "Global", System.Net.IWebProxy proxy = default, System.Net.Http.HttpMessageHandler finalHandler = default);
static member Create : seq<System.Net.Http.DelegatingHandler> * string * string * System.Net.IWebProxy * System.Net.Http.HttpMessageHandler -> System.Net.Http.HttpClient
Public Shared Function Create (handlers As IEnumerable(Of DelegatingHandler), Optional version As String = "v1.0", Optional nationalCloud As String = "Global", Optional proxy As IWebProxy = Nothing, Optional finalHandler As HttpMessageHandler = Nothing) As HttpClient
Parameters
- handlers
- IEnumerable<DelegatingHandler>
An ordered list of DelegatingHandler instances to be invoked as an HttpRequestMessage travels from the HttpClient to the network and an HttpResponseMessage travels from the network back to HttpClient. The handlers are invoked in a top-down fashion. That is, the first entry is invoked first for an outbound request message but last for an inbound response message.
- version
- String
The graph version to use.
- nationalCloud
- String
The national cloud endpoint to use.
- proxy
- IWebProxy
The proxy to be used with created client.
- finalHandler
- HttpMessageHandler
The last HttpMessageHandler to HTTP calls.
Returns
An HttpClient instance with the configured handlers.