postJSON method

Future postJSON(
  1. HttpClient httpClient,
  2. String path, {
  3. bool fullPath = false,
  4. Credential? authorization,
  5. Map<String, String?>? parameters,
  6. Object? body,
  7. String? contentType,
  8. String? accept,
  9. OnCachedResponse? onStaleResponse,
  10. Duration? staleResponseDelay,
})

Does a POST request and decodes response to JSON.

Implementation

Future<dynamic> postJSON(
  HttpClient httpClient,
  String path, {
  bool fullPath = false,
  Credential? authorization,
  Map<String, String?>? parameters,
  Object? body,
  String? contentType,
  String? accept,
  OnCachedResponse? onStaleResponse,
  Duration? staleResponseDelay,
}) async {
  return post(
    httpClient,
    path,
    fullPath: fullPath,
    authorization: authorization,
    parameters: parameters,
    body: body,
    contentType: contentType,
    accept: accept,
    onStaleResponse: onStaleResponse,
    staleResponseDelay: staleResponseDelay,
  ).then((r) => r.json);
}