diff --git a/nomos-cli/src/api/da.rs b/nomos-cli/src/api/da.rs index 35b4a9de..7a3d3c07 100644 --- a/nomos-cli/src/api/da.rs +++ b/nomos-cli/src/api/da.rs @@ -10,8 +10,7 @@ pub async fn get_blobs( const BLOBS_PATH: &str = "da/blobs"; CLIENT .post(node.join(BLOBS_PATH).unwrap()) - .header("Content-Type", "application/json") - .body(serde_json::to_string(&ids).unwrap()) + .json(&ids) .send() .await? .json() diff --git a/nomos-cli/src/api/mempool.rs b/nomos-cli/src/api/mempool.rs index 5ecc4e78..7c0d09da 100644 --- a/nomos-cli/src/api/mempool.rs +++ b/nomos-cli/src/api/mempool.rs @@ -9,8 +9,7 @@ where const NODE_CERT_PATH: &str = "mempool/add/cert"; CLIENT .post(node.join(NODE_CERT_PATH).unwrap()) - .header("Content-Type", "application/json") - .body(serde_json::to_string(cert).unwrap()) + .json(cert) .send() .await } diff --git a/nomos-cli/src/api/storage.rs b/nomos-cli/src/api/storage.rs index d7e8891a..75286556 100644 --- a/nomos-cli/src/api/storage.rs +++ b/nomos-cli/src/api/storage.rs @@ -10,12 +10,11 @@ pub async fn get_block_contents( block: &BlockId, ) -> Result>, reqwest::Error> { const BLOCK_PATH: &str = "storage/block"; - let block = CLIENT + CLIENT .post(node.join(BLOCK_PATH).unwrap()) - .body(serde_json::to_string(block).unwrap()) + .json(block) .send() .await? .json() - .await?; - Ok(block) + .await }