silver-ymz commented on code in PR #2838:
URL: 
https://github.com/apache/incubator-opendal/pull/2838#discussion_r1305060700


##########
core/src/services/gcs/core.rs:
##########
@@ -234,28 +233,38 @@ impl GcsCore {
         req = req.header(CONTENT_LENGTH, size.unwrap_or_default());
 
         if let Some(storage_class) = &self.default_storage_class {
-            req = req.header(CONTENT_TYPE, "multipart/related; 
boundary=my-boundary");
+            let mut multipart = Multipart::new();
 
-            let mut req_body = BytesMut::with_capacity(100);
-            write!(
-                &mut req_body,
-                "--my-boundary\nContent-Type: application/json; 
charset=UTF-8\n\n{{\"storageClass\": \"{}\"}}\n\n--my-boundary\n",
-                storage_class
-            ).unwrap();
+            multipart = multipart.part(
+                FormDataPart::new("metadata")
+                    .header(
+                        CONTENT_TYPE,
+                        "application/json; charset=UTF-8".parse().unwrap(),
+                    )
+                    .content(format!("{{\"storageClass\": \"{}\"}}", 
storage_class)),

Review Comment:
   updated in new commit



-- 
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]

Reply via email to