postJson method
Dispatches an HTTP request to url.
Implementation
Future<HttpResponseData> postJson(
String url, {
required Map<String, dynamic> jsonPayload,
Map<String, String> headers = const {},
bool dryRun = false,
}) async {
final body = jsonEncode(jsonPayload);
final reqHeaders = <String, String>{
'Content-Type': 'application/json; charset=utf-8',
...headers,
};
return sendRequest(
url,
method: 'POST',
headers: reqHeaders,
body: body,
dryRun: dryRun,
);
}