put method
Makes a PUT request to the specified uri
.
uri
: The endpoint to make the PUT request to.
data
: The data to include in the PUT request body.
queryParameters
: Optional query parameters to include in the request.
options
: Optional request options.
cancelToken
: Optional cancel token to cancel the request.
onSendProgress
: Optional callback to track the progress of the request.
onReceiveProgress
: Optional callback to track the progress of the response.
Returns the response from the PUT request.
Implementation
Future<Response> put(
String uri, {
data,
Map<String, dynamic>? queryParameters,
Options? options,
CancelToken? cancelToken,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
try {
await _configureDio();
final Response response = await _dio.put(
uri,
data: data,
queryParameters: queryParameters,
options: options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return response;
} catch (e) {
rethrow;
}
}