request method

Future<Response> request(
  1. Request request
)

Perform a server request for this request

A server request returns an http.Response object that includes the body as String, the bodyBytes as UInt8List and the json representation if available. It also contains the statusCode and reasonPhrase that may indicate an error, and several other fields that may be useful. A local error (e.g. a SocketException) will yield statusCode 499, with details in the reasonPhrase

The request will abide by the retries set on the request, and set headers included in the request

The http.Client object used for this request is the httpClient field of the downloader. If not set, the default http.Client will be used. The request is executed on an Isolate, to ensure minimal interference with the main Isolate

Implementation

Future<http.Response> request(Request request) => compute(_doRequest, (
      request,
      DesktopDownloader.requestTimeout,
      DesktopDownloader.proxy,
      DesktopDownloader.bypassTLSCertificateValidation
    ));