post static method
To make a post request
Implementation
static Future<HttpBaseClientResponse> post(
Uri uri, {
Map<String, String>? headers = const {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded"
},
Object? requestBody,
}) async {
var client = http.Client();
HttpBaseClientResponse res;
try {
var response = await client.post(
uri,
headers: headers,
body: requestBody,
);
res = HttpBaseClientResponse._fromHttpResponse(response);
} catch (err) {
res = HttpBaseClientResponse._fromError(err.toString());
} finally {
client.close();
}
return res;
}