httpMap top-level property

Map<String, Future<IResponse> Function(Object url, {Object? headers})> httpMap
getter/setter pair

Implementation

var httpMap = {
  'get': (Object url, {Object? headers}) {
    Map<String, String> _headers = {};
    if (headers is Map) {
      headers.forEach((key, value) {
        _headers[key.toString()] = value.toString();
      });
    }
    return get(url as Uri, headers: _headers).then((response) {
      return IResponse(response);
    });
  },
  'post': (Object url, {Object? headers, Object? body}) {
    Map<String, String> _headers = {};
    if (headers is Map) {
      headers.forEach((key, value) {
        _headers[key.toString()] = value.toString();
      });
    }
    return post(url as Uri, headers: _headers, body: body).then((response) {
      return IResponse(response);
    });
  }
};