HttpClientWrapper class
Wraps http.Client with:
- Automatic retry with exponential backoff (1 s, 2 s, 4 s).
- Respect for
429 Too Many Requestsand theRetry-Afterheader. Authorizationheader injection for GitHub URLs whenGITHUB_TOKENis set.- GitHub API
Acceptheader (application/vnd.github.v3+json). - Debug-level request/response logging via Logger.
Constructors
- HttpClientWrapper({Client? client})
- Creates a new wrapper.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
Release the underlying
http.Clientresources. -
get(
String url, {Map< String, String> ? headers}) → Future<HttpResponse> -
Perform an HTTP GET request to
url. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post(
String url, {Map< String, String> ? headers, Object? body}) → Future<HttpResponse> -
Perform an HTTP POST request to
urlwith an optional JSONbody. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited