put<T> static method
dynamic
put<T>(})
Implementation
static put<T>(String path,
{data,
Map<String, Object>? queryParameters,
Map<String, Object>? propertiesToLog,
Options? options,
CancelToken? cancelToken,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
bool trackTelemetry = true,
TelemetryClient? telemetryClient,
}) async {
final stopwatch = Stopwatch()..start();
final timestamp = DateTime.now().toUtc();
// TODO
// final contentLength = data.map((x) => x.value.length).reduce((a,b) => a + b);
try {
var response = await _dio.put(path,
data: data,
queryParameters: queryParameters,
options: options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress);
if (trackTelemetry) {
_sendTelemetry(response, null, "PUT", timestamp, path, queryParameters, propertiesToLog, stopwatch, telemetryClient);
}
return response;
} on DioError catch (error) {
_sendErrorTelemetry(error, 0, "PUT", timestamp, path, queryParameters, propertiesToLog, stopwatch, telemetryClient);
throw Future.error(error);
}
}