postString method
Implementation
Future<String> postString(
dynamic url, {
Map<String, dynamic>? body,
Map<String, String> headers = const {},
bool validate = true,
}) async {
assert(url is String || url is Uri);
if (url is String) {
url = Uri.parse(url);
}
final response = await post(url, headers: headers, body: json.encode(body));
if (_closed) throw HttpClientClosedException();
if (validate) {
_validateResponse(response, response.statusCode);
}
return response.body;
}