requestJSON method
Future
requestJSON(
- HttpClient httpClient,
- HttpMethod method,
- String path, {
- bool fullPath = false,
- Credential? authorization,
- Map<
String, String?> ? queryParameters, - Object? body,
- String? contentType,
- String? accept,
- OnCachedResponse? onStaleResponse,
- Duration? staleResponseDelay,
Does a request and decodes response to JSON.
- See requestURL documentation.
Implementation
Future<dynamic> requestJSON(
HttpClient httpClient, HttpMethod method, String path,
{bool fullPath = false,
Credential? authorization,
Map<String, String?>? queryParameters,
Object? body,
String? contentType,
String? accept,
OnCachedResponse? onStaleResponse,
Duration? staleResponseDelay}) async {
return request(httpClient, method, path,
fullPath: fullPath,
authorization: authorization,
queryParameters: queryParameters,
body: body,
contentType: contentType,
accept: accept,
onStaleResponse: onStaleResponse,
staleResponseDelay: staleResponseDelay)
.then((r) => r.json);
}