return application/json content-type for post api

This commit is contained in:
aglkm
2024-07-10 18:47:43 +03:00
parent ac27c5a064
commit 3e9648bf9c
4 changed files with 21 additions and 21 deletions

View File

@@ -80,9 +80,9 @@ pub async fn call(method: &str, params: &str, id: &str, rpc_type: &str) -> Resul
let client = reqwest::Client::new();
let result = client.post(rpc_url)
.body(format!("{{\"method\": \"{}\", \"params\": {}, \"id\": {}}}", method, params, id))
.body(format!("{{\"method\": \"{}\", \"params\": {}, \"id\": {}, \"jsonrpc\": \"2.0\"}}", method, params, id))
.basic_auth(CONFIG.user.clone(), Some(secret))
.header("content-type", "plain/text")
.header("content-type", "application/json")
.send()
.await?;