From 6cecd9f92acf4ea6d51e6fd89f6be7c0326b78d4 Mon Sep 17 00:00:00 2001 From: Charles Schleich Date: Tue, 28 May 2024 10:35:25 +0200 Subject: [PATCH] fix: application/json content headers not being set --- src/api/buckets.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/api/buckets.rs b/src/api/buckets.rs index 7e12501..3cc8cfc 100644 --- a/src/api/buckets.rs +++ b/src/api/buckets.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use snafu::ResultExt; use crate::models::{Buckets, PostBucketRequest}; -use crate::{Client, Http, RequestError, ReqwestProcessing, Serializing}; +use crate::{Client, Http, RequestError, ReqwestProcessing}; impl Client { /// List all buckets matching specified parameters @@ -47,10 +47,7 @@ impl Client { let response = self .request(Method::POST, &create_bucket_url) - .body( - serde_json::to_string(&post_bucket_request.unwrap_or_default()) - .context(Serializing)?, - ) + .json(&post_bucket_request.unwrap_or_default()) .send() .await .context(ReqwestProcessing)?;