postJSON method
Future
postJSON(
- HttpClient httpClient,
- String path, {
- bool fullPath = false,
- Credential? authorization,
- Map<
String, String?> ? parameters, - Object? body,
- String? contentType,
- String? accept,
- OnCachedResponse? onStaleResponse,
- Duration? staleResponseDelay,
Does a POST request and decodes response to JSON.
- See requestURL documentation.
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);
}