requestJson method
- HttpMethod method,
- String url,
- ApiVersion apiVersion,
- {Map<
String, dynamic> ? parameters, - String? rootElement}
Implementation
Future<dynamic> requestJson(
HttpMethod method, String url, ApiVersion apiVersion,
{Map<String, dynamic>? parameters, String? rootElement}) async {
final response = await EasyPostRequest.executeRequest(
config, method, url, apiVersion,
parameters: parameters);
dynamic json = jsonDecode(response.body);
if (rootElement != null) {
json = json[rootElement];
}
return json;
}