HttpRequest class

Raw transport request sent through an HttpClient.

Constructors

HttpRequest.new({required String endpoint, required String method, Map<String, dynamic>? query, Map<String, String>? headers, RequestBody body = const RequestBody.none(), ResponseTypeHint responseType = ResponseTypeHint.json})
Creates a transport request.
const

Properties

body RequestBody
Request payload description.
final
endpoint String
Endpoint path relative to the configured base URL.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
Request headers.
final
method String
HTTP method, such as GET or POST.
final
query Map<String, dynamic>?
Query parameters appended to the request URL.
final
responseType ResponseTypeHint
Response type hint for the underlying HTTP client.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? endpoint, String? method, Map<String, dynamic>? query, Map<String, String>? headers, RequestBody? body, ResponseTypeHint? responseType}) HttpRequest
Returns a copy of this request with selected fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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