put function
Implementation
Future<http.Response> put(String url, {Map<String, String>? headers, Object? body, int? timeOut}) async {
final Map<String, dynamic> request = {
"method": "PUT",
"url": url,
"headers": headers ?? const <String, String>{},
"body": body ?? "",
"timeOut": Duration(seconds: timeOut ?? _timeOut).inMilliseconds
};
if (_useNative){
return await _sendRequest(request);
} else {
return await http.put(
Uri.parse(url),
headers: headers,
encoding: Encoding.getByName("UTF-8"),
body: body
).timeout(Duration(seconds: timeOut ?? _timeOut));
}
}