put static method
Implementation
static Future<Response?> put(
Uri url, {
Map<String, String>? headers,
Object? body,
Encoding? encoding,
CancellationToken? cancelToken,
int retries = 3,
Duration? timeLimit,
Duration timeRetry = const Duration(milliseconds: 100),
FutureOr<Response> Function()? onTimeout,
}) async {
cancelToken?.throwIfCancellationRequested();
return await RetryHelper.tryRun<Response>(() {
return CancellationTokenSource.register(
cancelToken,
timeLimit == null
? _httpClient.put(
url,
headers: headers,
body: body,
encoding: encoding,
)
: _httpClient
.put(
url,
headers: headers,
body: body,
encoding: encoding,
)
.timeout(
timeLimit,
onTimeout: onTimeout,
),
);
}, cancelToken: cancelToken, timeRetry: timeRetry, retries: retries);
}