put<T> method
Implementation
Future<Response<T>> put<T>(
String url, {
dynamic body,
String? contentType,
Map<String, String>? headers,
Map<String, dynamic>? query,
Decoder<T>? decoder,
ResponseInterceptor<T>? responseInterceptor,
Progress? uploadProgress,
}) async {
try {
var response = await _performRequest<T>(
() => _request<T>(
url,
'put',
contentType: contentType,
query: query,
body: body,
decoder: decoder,
responseInterceptor: responseInterceptor,
uploadProgress: uploadProgress,
),
headers: headers,
);
return response;
} on Exception catch (e) {
if (!errorSafety) {
throw GetHttpException(e.toString());
}
return Future.value(Response<T>(
statusText: 'Can not connect to server. Reason: $e',
));
}
}