put method

Future<HttpResponse> put(
  1. String path, {
  2. Map<String, String>? headers,
  3. bool fullPath = false,
  4. Credential? authorization,
  5. Map<String, Object?>? parameters,
  6. String? queryString,
  7. Object? body,
  8. String? contentType,
  9. String? accept,
  10. String? responseType,
  11. ProgressListener? progressListener,
})

Does a PUT request.

Implementation

Future<HttpResponse> put(
  String path, {
  Map<String, String>? headers,
  bool fullPath = false,
  Credential? authorization,
  Map<String, Object?>? parameters,
  String? queryString,
  Object? body,
  String? contentType,
  String? accept,
  String? responseType,
  ProgressListener? progressListener,
}) async {
  var parametersMapStr = _toParametersMapOfString(parameters);
  var url = _buildURL(path, fullPath, parametersMapStr);

  var retUrlParameters = _buildURLAndParameters(
    url,
    parametersMapStr,
    queryString,
  );
  url = retUrlParameters.key;
  parametersMapStr = retUrlParameters.value;

  var authorizationOr = _buildRequestAuthorization(authorization);
  var requestAuthorization = authorizationOr is Future<Authorization?>
      ? await authorizationOr
      : authorizationOr;
  return _clientRequester.requestPUT(
    this,
    url,
    headers: headers,
    authorization: requestAuthorization,
    queryParameters: parametersMapStr,
    body: body,
    contentType: contentType,
    accept: accept,
    responseType: responseType,
    progressListener: progressListener,
  );
}