Class PnPHttpProvider
PnP http client which implements setting of User-Agent + retry mechanismn on throttling
Inheritance
System.Object
PnPHttpProvider
Namespace: PnP.Framework.Utilities
Assembly: PnP.Framework.dll
Syntax
public class PnPHttpProvider : HttpClient
Constructors
PnPHttpProvider(HttpMessageHandler, Boolean, Int32, Int32, String)
Constructor with HttpMessageHandler
Declaration
public PnPHttpProvider(HttpMessageHandler innerHandler, bool disposeHandler, int retryCount = 10, int delay = 500, string userAgent = null)
Parameters
Http HttpMessageHandler instance to pass along |
System. Declares whether to automatically dispose the internal HttpHandler instance |
System. Number of retries, defaults to 10 |
System. Incremental delay increase in milliseconds |
System. User-Agent string to set |
PnPHttpProvider(HttpMessageHandler, Int32, Int32, String)
Constructor with HttpMessageHandler
Declaration
public PnPHttpProvider(HttpMessageHandler innerHandler, int retryCount = 10, int delay = 500, string userAgent = null)
Parameters
Http HttpMessageHandler instance to pass along |
System. Number of retries, defaults to 10 |
System. Incremental delay increase in milliseconds |
System. User-Agent string to set |
PnPHttpProvider(Int32, Int32, String)
Constructor without HttpMessageHandler
Declaration
public PnPHttpProvider(int retryCount = 10, int delay = 500, string userAgent = null)
Parameters
System. Number of retries, defaults to 10 |
System. Incremental delay increase in milliseconds |
System. User-Agent string to set |
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Perform async http request
Declaration
public override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Http Http request to execute |
Cancellation cancellation token |
Returns
Task<Http Response object from http request |