asukaminato0721 commented on code in PR #5647:
URL: https://github.com/apache/opendal/pull/5647#discussion_r1966511655
##########
core/src/types/operator/operator.rs:
##########
@@ -1964,4 +1964,132 @@ impl Operator {
},
)
}
+
+ /// Presign an operation for delete.
+ ///
+ /// # Notes
+ ///
+ /// ## Extra Options
+ ///
+ /// `presign_delete` is a wrapper of [`Self::presign_delete_with`] without
any options.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// use std::time::Duration;
+ ///
+ /// use anyhow::Result;
+ /// use opendal::Operator;
+ ///
+ /// async fn test(op: Operator) -> Result<()> {
+ /// let signed_req = op
+ /// .presign_delete("test.txt", Duration::from_secs(3600))
+ /// .await?;
+ /// Ok(())
+ /// }
+ /// ```
+ ///
+ /// - `signed_req.method()`: `DELETE`
+ /// - `signed_req.uri()`:
`https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>`
+ /// - `signed_req.headers()`: `{ "host": "s3.amazonaws.com" }`
+ ///
+ /// We can upload file as this file via `curl` or other tools without
credential:
+ ///
+ /// ```shell
+ /// curl -X DELETE
"https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>"
-d "Hello, World!"
Review Comment:
```suggestion
/// curl -X DELETE
"https://s3.amazonaws.com/examplebucket/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=access_key_id/20130721/us-east-1/s3/aws4_request&X-Amz-Date=20130721T201207Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=<signature-value>"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]