chore: add more headers
This commit is contained in:
@@ -13,7 +13,7 @@ use super::ApiError;
|
|||||||
use nyquest::{
|
use nyquest::{
|
||||||
AsyncClient, Body,
|
AsyncClient, Body,
|
||||||
r#async::Request,
|
r#async::Request,
|
||||||
header::{ACCEPT_ENCODING, CONTENT_ENCODING, COOKIE, EXPECT, USER_AGENT},
|
header::{ACCEPT, ACCEPT_ENCODING, CONTENT_ENCODING, CONTENT_TYPE, COOKIE, EXPECT, USER_AGENT},
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use spdlog::debug;
|
use spdlog::debug;
|
||||||
@@ -54,13 +54,15 @@ pub trait MaiVersionExt: MaiVersion {
|
|||||||
.with_body(Body::json_bytes(payload))
|
.with_body(Body::json_bytes(payload))
|
||||||
.with_header(USER_AGENT, format!("{api_hash}#{agent_extra}"))
|
.with_header(USER_AGENT, format!("{api_hash}#{agent_extra}"))
|
||||||
.with_header("Mai-Encoding", Self::VERSION)
|
.with_header("Mai-Encoding", Self::VERSION)
|
||||||
|
.with_header(ACCEPT, "*/*")
|
||||||
.with_header(ACCEPT_ENCODING, "")
|
.with_header(ACCEPT_ENCODING, "")
|
||||||
.with_header("Charset", "UTF-8")
|
.with_header("Charset", "UTF-8")
|
||||||
.with_header(CONTENT_ENCODING, "deflate")
|
.with_header(CONTENT_ENCODING, "deflate")
|
||||||
|
.with_header(CONTENT_TYPE, "application/json")
|
||||||
.with_header(EXPECT, "100-continue");
|
.with_header(EXPECT, "100-continue");
|
||||||
|
|
||||||
// TODO: userid, token
|
// TODO: userid, token
|
||||||
if Self::VERSION >= "1.53" {
|
if Self::VERSION >= "1.53" && false {
|
||||||
req = req.with_header(COOKIE, format!(""))
|
req = req.with_header(COOKIE, format!(""))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user