HttpClientWrapper class

Wraps http.Client with:

  • Automatic retry with exponential backoff (1 s, 2 s, 4 s).
  • Respect for 429 Too Many Requests and the Retry-After header.
  • Authorization header injection for GitHub URLs when GITHUB_TOKEN is set.
  • GitHub API Accept header (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.Client resources.
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 url with an optional JSON body.
toString() String
A string representation of this object.
inherited

Operators

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