Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix little missunderstanding #1895

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

JamesHertz
Copy link

The documentation of Document.postDataCharset(String charset) says: "Sets the default post data character set for x-www-form-urlencoded post data."

At first I thought, it was not about the POST request but about the x-www-form-urlencoded data. Which means, that if I used this method sending a charset B as argument, even if I do a GET request the x-www-form-urlencoded data in it would've been converted into chartset B.

What is actually happening is that it's all about POST request and somehow it feels a bit weird. What is happening is that when it's a POST request Jsoup uses the charSet specified by postDataCharSet to transform the x-www-form-urlencoded data but for everything else it just uses a default charSet. The most funny thing is that the variable that postDataCharSet affects is initialized with this default charset.

I think that it would be better if Jsoup just used this value (specified using postDataCharSet) to transform x-www-form-urlencoded data, no matter the method used (as long as the method allows such kind of data).

I just changed two lines of code to make that happen.

I hope you reconsider this, it would make some people life easiser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants