post static method
POST 请求
Implementation
static Future<http.Response> post(
String url, {
Map<String, String>? headers,
Object? body,
Duration timeout = const Duration(seconds: 30),
}) async {
_logRequest('POST', url, headers: headers, body: body);
try {
final response = await http
.post(Uri.parse(url), headers: headers, body: body)
.timeout(timeout);
_logResponse('POST', url, response);
return response;
} catch (e) {
_logError('POST', url, e);
rethrow;
}
}