Skip to content
Discussion options

You must be logged in to vote

Is there a way to modify the encoding when sending?

I guess you'd need to send this as pre-encoding bytes, setting the Content-Type header explicitly?...

data = {"message1": "测试".encode("gbk")}
content = urlencode(data)
httpx.post(url, content=content, headers={"Content-Type": "application/x-www-form-urlencoded"})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nisekoi5
Comment options

Answer selected by Nisekoi5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants