HttpHelper class

Helpers for working with HTTP

Constructors

HttpHelper()

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

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

Static Properties

client HttpClient
Main HTTP Client
getter/setter pair

Static Methods

connectToWebSocket(String url, {Iterable<String>? protocols, Map<String, dynamic>? headers, HttpClient? httpClient, bool? useStandardWebSocket}) Future<WebSocket>
Custom WebSocket Connection logic.
createRequest(String method, String url, {Map<String, String>? headers}) Future<HttpClientRequest>
Creates an HttpClientRequest with the given parameters. method is the HTTP method. url is the URL to make the request to. headers specifies additional headers to set.
fetchJSON(String url, {Map<String, String>? headers}) Future
Fetches the specified url from HTTP as json. If headers is specified, the headers will be added onto the request.
fetchUrl(String url, {Map<String, String>? headers}) Future<String>
Fetches the specified url from HTTP. If headers is specified, the headers will be added onto the request.
readBytesFromResponse(HttpClientResponse response) Future<List<int>>
Reads the entire response as a list of bytes.
tokenizeFieldValue(String headerValue) List<String>
upgradeToWebSocket(HttpRequest request, [dynamic protocolSelector(List<String> protocols)?, bool? useStandardWebSocket]) Future<WebSocket>

Constants

enableStandardWebSocket → const bool