request static method
Implementation
static Future<Response> request({
required String method,
required String path,
required String site,
Map<String, String>? parameters,
Map<String, String>? headers,
Object? body,
}) async {
final uri = Uri.https(site, path, parameters);
switch (method) {
case 'get':
return http.get(uri);
case 'post':
return http.post(uri, headers: headers, body: body);
case 'put':
return http.put(uri);
case 'delete':
return http.delete(uri);
}
throw Exception('Invalid method');
}