post static method

Future<Response> post({
  1. required String url,
  2. required String apiKey,
  3. required Map<String, dynamic> body,
})

Implementation

static Future<http.Response> post(
    {required String url,
    required String apiKey,
    required Map<String, dynamic> body}) async {
  return http.post(Uri.parse(url),
      headers: {
        'Authorization': 'Bearer $apiKey',
        'Content-Type': 'application/json'
      },
      body: json.encode(body));
}