PDA

View Full Version : Some problem when using QUrl::addQueryItem method



xyjian
28th March 2011, 18:44
In my project I want to visit an url with some arguments and catch the return parameters. I take the following codes for test.

QUrl url = QString("http://localhost/test")
url.addQueryItem("test", QString("abc+bcd"));

But the arguments my server received is "abc bcd". I'm sure the error occured when url.addQueryItem executed but I don't know how to fix it. Simply modifying the '+' character by "%2B" doesn't work.
Who could help me? thanks very much!

xyjian
29th March 2011, 10:12
the answer could be found here:
http://www.qtcentre.org/threads/40121-encode-in-url.addQueryItem