Problem with automatic url encoding
Hi,
For a REST webservice I need to submit data with an exact format:
[QUOTE]
[url]http://myserver.com/test.php?test=a%3D[/url]
[/QUOTE]
The sample parameter value for "test" should be exactly "a%3D" (which is the percentage encoding for "a="). When I enter the url in Firefox it arrives at the test.php script as intended. But when I use the QNetworkAccessManager "a%3D" is percentage encoded again and arriving as "a%253D" on the server. The whole Qt code is as follows:
[CODE]
QNetworkAccessManager m_nam;
QString strUrl = "http://myserver.com/test.php?test=a%3D";
QUrl url(strUrl);
QNetworkRequest request(url);
m_nam->get(request);
[/CODE]
I also tried to set strUrl without percentage encoding with the hope that it might be encoded:
[code]
QString strUrl = "http://myserver.com/test.php?test=a=";
[/code]
but this returns "test=a=" instead of "test=a%3D" on the server.
How can fix this encoding problem?
Regards,
Re: Problem with automatic url encoding
I think I found it (based on the suggestions of other threads after posting...):
[code]
QUrl url = QUrl::fromUserInput(strUrl);
[/code]