45 lines
1.8 KiB
C#
45 lines
1.8 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using System.Net.Http.Headers;
|
|
using System.Runtime.Versioning;
|
|
|
|
namespace Discord.API.Rest.HttpClientWrapper;
|
|
|
|
public class HttpClientWrapper : HttpClient, IHttpClientWrapper{
|
|
//
|
|
// Summary:
|
|
// Initializes a new instance of the System.Net.Http.HttpClient class using a System.Net.Http.HttpClientHandler
|
|
// that is disposed when this instance is disposed.
|
|
public HttpClientWrapper() : base() { }
|
|
//
|
|
// Summary:
|
|
// Initializes a new instance of the System.Net.Http.HttpClient class with the specified
|
|
// handler. The handler is disposed when this instance is disposed.
|
|
//
|
|
// Parameters:
|
|
// handler:
|
|
// The HTTP handler stack to use for sending requests.
|
|
//
|
|
// Exceptions:
|
|
// T:System.ArgumentNullException:
|
|
// The handler is null.
|
|
public HttpClientWrapper(HttpMessageHandler handler) : base(handler) { }
|
|
//
|
|
// Summary:
|
|
// Initializes a new instance of the System.Net.Http.HttpClient class with the provided
|
|
// handler, and specifies whether that handler should be disposed when this instance
|
|
// is disposed.
|
|
//
|
|
// Parameters:
|
|
// handler:
|
|
// The System.Net.Http.HttpMessageHandler responsible for processing the HTTP response
|
|
// messages.
|
|
//
|
|
// disposeHandler:
|
|
// true if the inner handler should be disposed of by HttpClient.Dispose; false
|
|
// if you intend to reuse the inner handler.
|
|
//
|
|
// Exceptions:
|
|
// T:System.ArgumentNullException:
|
|
// The handler is null.
|
|
public HttpClientWrapper(HttpMessageHandler handler, bool disposeHandler) : base(handler, disposeHandler) { }
|
|
} |