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

QML XMLHttpRequest does not support the OPTIONS method

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.0
    • 5.2.0
    • None
    • Using Qt 5.2.0 64-bit on Debian
    • 2c54d85bf70e078ab1dfb1465567512aded5cf9d

    Description

      var request = new XMLHttpRequest();
      request.open("OPTIONS", resource.url)
      request.send()
      

      Result:

      Error: Unsupported HTTP method type

      QTBUG-17963 has similar case with the difference that deleteResource is implemented as public method on QNetworkAccessManager while to support OPTIONS method one should use QNetworkAccessManager::sendCustomRequest as the documentation suggests:

      This sendCustomRequest method provides means to send verbs other than the common ones provided via get() or post() etc., for instance sending an HTTP OPTIONS command.

      Since the OPTIONS method is considered custom request and sendCustomRequest also takes a third optional argument, maybe the solution would not be to add another else if in qqmlxmlhttprequest.cpp but rather expose a new function for custom requests?

      Or is this out of scope for QML? Should I just expose sendCustomRequest my self for use in QML?

      Use case for this in my case would be to create Qt Quick only, Hypermedia client which need OPTIONS verb to get available options for some resource.

      Attachments

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

        Activity

          People

            vkotov Valery Kotov
            rebus Davor Lučić
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes