callFunction method

Future<Response> callFunction(
  1. Uri url, {
  2. Map<String, String>? headers,
  3. Object? body,
})

Implementation

Future<http.Response> callFunction(
  Uri url, {
  Map<String, String>? headers,
  Object? body,
}) {
  switch (this) {
    case HttpClientRequestType.get:
      return http.get(url, headers: headers);
    case HttpClientRequestType.post:
      return http.post(url, headers: headers, body: body);
    case HttpClientRequestType.put:
      return http.put(url, headers: headers, body: body);
    case HttpClientRequestType.delete:
      return http.delete(url, headers: headers, body: body);
  }
}