×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    445

    Problem with automatic url encoding

    Hi,

    For a REST webservice I need to submit data with an exact format:
    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);
    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=";
    but this returns "test=a=" instead of "test=a%3D" on the server.

    How can fix this encoding problem?

    Regards,

  2. #2
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    445

    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);

Similar Threads

  1. About automatic find problem
    By shengyinpeng7 in forum General Development Questions
    Replies: 7
    Last Post: 2009-11-19, 09:42
  2. N97 SMS automatic deletion problem
    By fexnok in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2009-10-21, 11:23
  3. [moved] n96 automatic log deletion problem - urgent help need
    By jeeli in forum General Development Questions
    Replies: 2
    Last Post: 2008-11-14, 13:27
  4. automatic calls 6630 problem
    By Arshbaig in forum General Development Questions
    Replies: 2
    Last Post: 2008-08-05, 16:38
  5. Automatic Link Key exchange (automatic pairing)
    By nschmede in forum Bluetooth Technology
    Replies: 5
    Last Post: 2004-10-29, 09:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×