Injecting custom headers in QtWebEngineView

  • Hello,

    I was wondering if it possible to inject custom headers with QtWebEngineView. I am loading a webview and initial http request should have a custom header. Before upgrading to qt5.7, I would inject them during QNetworkAccessManager.createRequest(). Now, since QNetworkAccessManager can not be attached to QWebEngineView, it's not an option. I've read QtWebEngineView and QtWebPage documentation to see if I could find something relevant, but couldn't find a solution...
    Here are relevant parts of the code:

    void webPage::start()
        QString m_startUrl = ""

    I would like to insert a custom header only once when performing

    Any suggestions are appreciated

  • Moderators

  • Thank you so much! That should do it!

Log in to reply