get static method

Future<Response> get(
  1. Object url, {
  2. Map<String, String>? headers,
})

Makes a GET request to the specified url. The url can be either a String or a Uri object.

Implementation

static Future<http.Response> get(
  Object url, {
  Map<String, String>? headers,
}) async {
  try {
    final uri = _toUri(url);
    return _client.get(uri, headers: headers);
  } catch (e) {
    if (e is HTTPSException) {
      rethrow;
    } else {
      Error.throwWithStackTrace(
        HTTPSException(
          message: 'Failed to make GET request to $url: ${e.toString()}',
          originalError: e,
        ),
        StackTrace.current,
      );
    }
  }
}