Results 1 to 3 of 3

Thread: Http request encoding

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Http request encoding

    The error response from the upstream server is of precisely no use. Without an actual example of the data you claim is mis-encoded and how you are handling it we can just guess what is going wrong.

    According to RFC 3986, which QUrl implements, the following characters are permitted in a query string component:
    query = *( pchar / "/" / "?" )
    pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
    sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
    and then Section 2.4 kicks in:
    Under normal circumstances, the only time when octets within a URI
    are percent-encoded is during the process of producing the URI from
    its component parts. This is when an implementation determines which
    of the reserved characters are to be used as subcomponent delimiters
    and which can be safely used as data.
    For URL query strings only the '&' and '=' are used as a sub-component delimiters and therefore must be encoded if part of the data. So '$', '/', and most other characters from the "reserved" set are perfectly fine unencoded in this context.

    If you wish to do some funky encoding of your own then feel free. You can use QUrl::addEncodedQueryItem() to put these into the QUrl.

  2. The following user says thank you to ChrisW67 for this useful post:

    Trok (30th September 2011)

Similar Threads

  1. Http request
    By kars in forum Newbie
    Replies: 3
    Last Post: 31st August 2011, 10:15
  2. How to make a HTTP request in QTJambi
    By divanshu in forum Newbie
    Replies: 2
    Last Post: 28th June 2011, 06:29
  3. HTTP request
    By Trok in forum Qt Programming
    Replies: 9
    Last Post: 5th January 2010, 14:49
  4. http POST with form encoding
    By srikanth_trulyit in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2009, 10:16
  5. http request
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 28th December 2008, 19:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.