put method

Future put({
  1. required String url,
  2. required Object? body,
  3. Map<String, String>? header,
})

PUT

Implementation

Future<dynamic> put({required String url, required Object? body, Map<String, String>? header}) async {
  dynamic responseJson;
  try {
    final response = await http.put(Uri.parse(url), headers: headers ?? header, body: body);
    responseJson = _returnResponse(response);
  } on SocketException {
    throw FetchDataException('No Internet connection');
  }
  return responseJson;
}