Skip to content

Commit

Permalink
Add custom verb support for WASM HTTP requests
Browse files Browse the repository at this point in the history
The QNetworkReply implementation for Qt for WebAssembly now supports
usage of the QNetworkAccessManager::sendCustomRequest, making it
possible to send requests with custom verbs.

[ChangeLog][QtNetwork][QNetworkAccessManager] Fixed
QNetworkAccessManager::sendCustomRequest for Qt For WebAssembly.

Fixes: QTBUG-76775
Change-Id: I9394ffef110fce4ed2c877893631bedc7631f71e
Reviewed-by: Lorn Potter <[email protected]>
  • Loading branch information
Skycoder42 committed Jul 3, 2019
1 parent 6ff0614 commit 0f92f2f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/network/access/qnetworkreplywasmimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ QNetworkReplyWasmImpl::~QNetworkReplyWasmImpl()

QByteArray QNetworkReplyWasmImpl::methodName() const
{
const Q_D( QNetworkReplyWasmImpl);
switch (operation()) {
case QNetworkAccessManager::HeadOperation:
return "HEAD";
Expand All @@ -247,6 +248,8 @@ QByteArray QNetworkReplyWasmImpl::methodName() const
return "POST";
case QNetworkAccessManager::DeleteOperation:
return "DELETE";
case QNetworkAccessManager::CustomOperation:
return d->request.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray();
default:
break;
}
Expand Down

0 comments on commit 0f92f2f

Please sign in to comment.