use reqwest json() method (#525)
This commit is contained in:
parent
421ea6c0c7
commit
a524cc2dcf
|
@ -10,8 +10,7 @@ pub async fn get_blobs(
|
||||||
const BLOBS_PATH: &str = "da/blobs";
|
const BLOBS_PATH: &str = "da/blobs";
|
||||||
CLIENT
|
CLIENT
|
||||||
.post(node.join(BLOBS_PATH).unwrap())
|
.post(node.join(BLOBS_PATH).unwrap())
|
||||||
.header("Content-Type", "application/json")
|
.json(&ids)
|
||||||
.body(serde_json::to_string(&ids).unwrap())
|
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.json()
|
.json()
|
||||||
|
|
|
@ -9,8 +9,7 @@ where
|
||||||
const NODE_CERT_PATH: &str = "mempool/add/cert";
|
const NODE_CERT_PATH: &str = "mempool/add/cert";
|
||||||
CLIENT
|
CLIENT
|
||||||
.post(node.join(NODE_CERT_PATH).unwrap())
|
.post(node.join(NODE_CERT_PATH).unwrap())
|
||||||
.header("Content-Type", "application/json")
|
.json(cert)
|
||||||
.body(serde_json::to_string(cert).unwrap())
|
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,11 @@ pub async fn get_block_contents(
|
||||||
block: &BlockId,
|
block: &BlockId,
|
||||||
) -> Result<Option<Block<Tx, Certificate>>, reqwest::Error> {
|
) -> Result<Option<Block<Tx, Certificate>>, reqwest::Error> {
|
||||||
const BLOCK_PATH: &str = "storage/block";
|
const BLOCK_PATH: &str = "storage/block";
|
||||||
let block = CLIENT
|
CLIENT
|
||||||
.post(node.join(BLOCK_PATH).unwrap())
|
.post(node.join(BLOCK_PATH).unwrap())
|
||||||
.body(serde_json::to_string(block).unwrap())
|
.json(block)
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.json()
|
.json()
|
||||||
.await?;
|
.await
|
||||||
Ok(block)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue