Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13403

Documentation flaw in QUrl regarding HTML form data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 4.7.1
    • 4.6.3
    • Core: I/O, Network
    • None
    • db6c424

    Description

      Regarding Thiago Macieira's comment on QTBUG-10146, QUrl isn't and won't ever be suitable to encode HTML form data, which is needed communicate with web applications. This is highly counter-intuitive, so it should be mentioned in the documentation.

      Proposal for the method description of QUrl::addQueryItem():

      Important Note:
      This method is not suitable to add HTML form data to the query string. When communicating with web applications, always use instead:

      url.addEncodedQueryItem(QUrl::toPercentEncoding(key), QUrl::toPercentEncoding(value));

      A similar note should be added to the documentation of QUrl::setQueryItems().

      Proposal for the method description of QUrl::queryItemValue():

      Important Note:
      This method is not suitable to decode HTML form data from the query string. When communicating with web browsers, always use instead:

      QUrl::fromPercentEncoding(url.encodedQueryItemValue(key).replace('+', ' '));

      A similar note should be added to the documentation of QUrl::queryItems().

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
            vog Volker Grabsch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes