HttpRequest class

Represents the HTTP request.

Constructors

HttpRequest(HttpMethod method, String url, String requestURL, {Map<String, String?>? queryParameters, bool noQueryString = false, Authorization? authorization, bool withCredentials = false, String? responseType, String? mimeType, Map<String, String>? requestHeaders, Object? sendData})

Properties

authorization Authorization?
Authorization instance for the request.
final
hashCode int
The hash code for this object.
no setterinherited
headerAccept String?
Returns the header: Accept
no setter
headerContentLength String?
Returns the header: Content-Length
no setter
headerContentType String?
Returns the header: Content-Type
getter/setter pair
headerContentTypeCharset String?
Returns the header Content-Type charset.
getter/setter pair
headerContentTypeMimeType String?
Returns the header Content-Type Mime-Type (without the charset).
getter/setter pair
headerTransferEncoding String?
Returns the header: Transfer-Encoding
no setter
method HttpMethod
HTTP Method.
final
mimeType String?
MimeType of request sent data (body).
final
noQueryString bool
If true avoid a request URL with a queryString.
final
queryParameters Map<String, String?>?
The query parameters of the request.
final
requestHeaders Map<String, String>?
Headers of the request.
no setter
requestURL String
Actual requested URL.
final
responseType String?
Tells the server the desired response format.
final
retries int
Number of retries for this request.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendData → dynamic
Data/body to send with the request.
no setter
sendDataAsString String?
sendData as a String.
no setter
sendDataLength int?
sendData length in bytes.
no setter
url String
Requested URL.
final
withCredentials bool
final

Methods

copyWithAuthorization(HttpClient client, [Authorization? authorization]) HttpRequest
Copies this instance with a different client and authorization if provided.
incrementRetries() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
updateContentLength() → void

Operators

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