[Development] QTBUG-35892. QML XMLHttpRequest does not support the OPTIONS method.

Валерий Котов kotov.valery at gmail.com
Wed Sep 3 19:05:20 CEST 2014


Greetings everybody!

I'm working on QTBUG-35892 (
https://bugreports.qt-project.org/browse/QTBUG-35892) feature request:
adding support for HTTP OPTIONS method for QML XmlHttpRequest class.
>From discussion with Richard Moore and Thiago Macieira I understood that 2
methods should be added to QNetworkAccessManager class: for "OPTIONS URL"
and for "OPTIONS *" requests.

In my understanding in should be something like the following:
QNetworkReply *resourceOptions(const QNetworkRequest &request, QIODevice
*data);
QNetworkReply *resourceOptions(const QNetworkRequest &request, const
QByteArray &data);
QNetworkReply *commonOptions(const QNetworkRequest &request, const QIODevice
*data);
QNetworkReply *commonOptions(const QNetworkRequest &request, const
QByteArray &data);

We also should reject "OPTIONS *" request when HTTP proxy is in use.
Unfortunately, I'm a little unsure what exactly should we do to reject the
request.
Should we check if HTTP proxy is in use inside commonOptions and return 0?
Or should this check be performed later when we create http header (e.g. in
QHttpProtocolHandler::sendRequest or QHttpNetworkRequestPrivate::header)?

How "OPTIONS *" call should be represented in QML? Should it be something
like this:
var x = new XMLHttpRequest;
x.open("OPTIONS", url);      // for request with url
var x = new XMLHttpRequest;
x.open("OPTIONS *", url);    // for request with asterisk

Any suggestions are welcome.

Thank you for your support!
-- 

Sincerely yours, Valery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140903/2f52eabf/attachment.html>


More information about the Development mailing list