get method

  1. @override
Future<Response> get({
  1. Map<String, String>? headers,
  2. Uri? uri,
})
inherited

Send a GET request.

If uri is given, the request will be sent to that exact uri. If uri is null, the uri on the BaseRequest will be used (and is thus required).

If headers are given, they will be merged with the set of headers already defined on the BaseRequest.

Note: For now, prefer streamGet for responses that could be binary in order to avoid encoding issues when reading the body as bytes (we hope to lift this restriction in the future).

Implementation

@override
Future<Response> get({Map<String, String>? headers, Uri? uri}) async {
  final response = await _send('GET', headers: headers, uri: uri);
  assert(response is Response, 'get() should return a Response');
  return response as Response;
}