HttpRequest class abstract

An HTTP request to be made against the API.

This class is a wrapper around the BaseRequest class from package:http, providing rate limit, audit log and authentication support.

Implementers

Constructors

HttpRequest(HttpRoute route, {String method = 'GET', Map<String, String> queryParameters = const {}, Map<String, String> headers = const {}, String? auditLogReason, bool authenticated = true, bool applyGlobalRateLimit = true})
Create a new HttpRequest.

Properties

applyGlobalRateLimit bool
Whether to apply the global rate limit to this request.
final
auditLogReason String?
The audit log reason for this request.
final
authenticated bool
Whether to add authentication to this request when sending it.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The headers for this request.
final
method String
The method for this request.
final
queryParameters Map<String, String>
The query parameters for this request.
final
rateLimitId String
The identifier for the rate limit bucket for this request.
no setter
route HttpRoute
The route for this request.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare(Nyxx client) BaseRequest
Transform this HttpRequest into a BaseRequest to be sent.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

authorization → const String
The name of the header containing the authentication for a request.
userAgent → const String
The name of the header containing the user agent for a request.
xAuditLogReason → const String
The name of the header containing the audit log reason for a request.