HttpRequest class

HTTP request entity

Constructors

HttpRequest({required String method, required String url, Map<String, String> headers = const {}, Map<String, dynamic>? queryParameters, dynamic body, Duration timeout = const Duration(seconds: 30), bool useToken = true, int maxRetries = 3, List<int> retryStatusCodes = const [408, 502, 503, 504, 429], bool rethrowExceptions = false})
const

Properties

body → dynamic
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
final
maxRetries int
final
method String
final
queryParameters Map<String, dynamic>?
final
rethrowExceptions bool
final
retryStatusCodes List<int>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
final
url String
final
useToken bool
final

Methods

copyWith({String? method, String? url, Map<String, String>? headers, Map<String, dynamic>? queryParameters, dynamic body, Duration? timeout, bool? useToken, int? maxRetries, List<int>? retryStatusCodes, bool? rethrowExceptions}) HttpRequest
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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