[Qtwebengine] Modifying request Headers for QML's WebEngineView

Michael Bruning Michael.Bruning at qt.io
Tue May 24 12:30:53 CEST 2016

Hi Neil,

at the moment, we provide the option to set request headers via the Core APIs QWebEngineUrlRequestInterceptor (http://doc.qt.io/qt-5/qwebengineurlrequestinterceptor.html), which can be used to manipulate the request headers using QWebEngineUrlRequestInfo::setHttpHeader (http://doc.qt.io/qt-5/qwebengineurlrequestinfo.html#setHttpHeader) . While these are C++ APIs, it should be possible to use them with an application that uses QML to display the UI.

I am not sure if that would fit the needs you have.

Best regards,


From: QtWebEngine <qtwebengine-bounces+michael.bruning=qt.io at qt-project.org> on behalf of Neil Williams <neil+qt at copycopy.cc>
Sent: Tuesday, May 24, 2016 12:06 PM
To: qtwebengine at qt-project.org
Subject: [Qtwebengine] Modifying request Headers for QML's WebEngineView

Are there any plans to allow modifying of a request header's, or intercept requests via the QML WebEngineView component?

We have a c++ backend with a qml frontend, occasionally we need to display web content within the App authenticated by the request headers (cookies + others). At the moment we have to use QtWebKit (waiting to see if QWebEngine can be submitted to the mac store in 5.7) and swap it around within a QStackedWidget with a Qml Widget. This obviously forces our hand in terms of how our app is composed and it is not ideal.

I am aware that we won't be able to hook QNAM into QWebEngine ever, but allowing more control of the requests that originate from WebEngineView would do for now.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qtwebengine/attachments/20160524/92aa0108/attachment.html>

More information about the QtWebEngine mailing list