Class BaseRestRequest
Represents a request sent over HTTP.
Inheritance
System.Object
BaseRestRequest
Namespace: DisCatSharp.Net
Assembly: DisCatSharp.dll
Syntax
public abstract class BaseRestRequest
Properties
| Improve this Doc View SourceDiscord
Gets the discord client.
Declaration
protected BaseDiscordClient Discord { get; }
Property Value
Type | Description |
---|---|
BaseDiscordClient |
Headers
Gets the headers sent with this request.
Declaration
public IReadOnlyDictionary<string, string> Headers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.String, System.String> |
Method
Gets the HTTP method used for this request.
Declaration
public RestRequestMethod Method { get; }
Property Value
Type | Description |
---|---|
RestRequestMethod |
RateLimitWaitOverride
Gets the override for the rate limit bucket wait time.
Declaration
public double? RateLimitWaitOverride { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
RequestTaskSource
Gets the request task source.
Declaration
protected TaskCompletionSource<RestResponse> RequestTaskSource { get; }
Property Value
Type | Description |
---|---|
System.Threading.Tasks.TaskCompletionSource<RestResponse> |
Route
Gets the generic path (no parameters) for this request.
Declaration
public string Route { get; }
Property Value
Type | Description |
---|---|
System.String |
Url
Gets the url to which this request is going to be made.
Declaration
public Uri Url { get; }
Property Value
Type | Description |
---|---|
System.Uri |
Methods
| Improve this Doc View SourceSetCompleted(RestResponse)
Sets as completed.
Declaration
protected void SetCompleted(RestResponse response)
Parameters
Type | Name | Description |
---|---|---|
RestResponse | response | The response to set. |
SetFaulted(Exception)
Sets as faulted.
Declaration
protected void SetFaulted(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception to set. |
TrySetFaulted(Exception)
Tries to set as faulted.
Declaration
protected bool TrySetFaulted(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception to set. |
Returns
Type | Description |
---|---|
System.Boolean |
WaitForCompletionAsync()
Asynchronously waits for this request to complete.
Declaration
public Task<RestResponse> WaitForCompletionAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<RestResponse> | HTTP response to this request. |