})
}
+ fn put<'a, T>(&'a self, path_and_query: &'a str, params: &T) -> Self::ResponseFuture<'a>
+ where
+ T: ?Sized + Serialize,
+ {
+ let params = serde_json::to_string(params)
+ .map_err(|err| Error::internal("failed to serialize parametres", err));
+
+ Box::pin(async move {
+ let params = params?;
+ let auth = self.login_auth()?;
+ let uri = self.build_uri(path_and_query)?;
+ let client = Arc::clone(&self.client);
+ Self::authenticated_request(client, auth, http::Method::PUT, uri, Some(params)).await
+ })
+ }
+
+ fn put_without_body<'a>(&'a self, path_and_query: &'a str) -> Self::ResponseFuture<'a> {
+ Box::pin(async move {
+ let auth = self.login_auth()?;
+ let uri = self.build_uri(path_and_query)?;
+ let client = Arc::clone(&self.client);
+ Self::authenticated_request(client, auth, http::Method::PUT, uri, None).await
+ })
+ }
+
fn delete<'a>(&'a self, path_and_query: &'a str) -> Self::ResponseFuture<'a> {
Box::pin(async move {
let auth = self.login_auth()?;
where
T: ?Sized + Serialize;
+ /// `PUT` request with a path and query component (no hostname), and a serializable body.
+ ///
+ /// The body should be serialized to json and sent with `Content-type: applicaion/json`.
+ ///
+ /// For this request, authentication headers should be set!
+ fn put<'a, T>(&'a self, path_and_query: &'a str, params: &T) -> Self::ResponseFuture<'a>
+ where
+ T: ?Sized + Serialize;
+
+ /// `PUT` request with a path and query component (no hostname), no request body.
+ ///
+ /// For this request, authentication headers should be set!
+ fn put_without_body<'a>(&'a self, path_and_query: &'a str) -> Self::ResponseFuture<'a>;
+
/// `DELETE` request with a path and query component (no hostname).
///
/// For this request, authentication headers should be set!