Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebEngine get response headers
Forum Updated to NodeBB v4.3 + New Features

QWebEngine get response headers

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Devoo
    wrote on last edited by
    #1

    Hi,
    Is there any way to get response headers using QWebEnigne (Quick or Widget module)?

    JonBJ 1 Reply Last reply
    0
    • D Devoo

      Hi,
      Is there any way to get response headers using QWebEnigne (Quick or Widget module)?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Devoo
      Assuming you are Qt 5.6+, I bleieve your are supposed to accomplish this via QWebEngineUrlRequestInterceptor Class. See https://stackoverflow.com/questions/40309105/capture-server-response-with-qwebengineview

      1 Reply Last reply
      2
      • D Offline
        D Offline
        Devoo
        wrote on last edited by
        #3

        @JonB
        "Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on the profile enables intercepting, blocking, and modifying URL requests before they reach the networking stack of Chromium."

        As I understand it, this class is used to modify the request before it is sent, not after.
        How can I use this class to read response headers?

        JonBJ 1 Reply Last reply
        0
        • D Devoo

          @JonB
          "Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on the profile enables intercepting, blocking, and modifying URL requests before they reach the networking stack of Chromium."

          As I understand it, this class is used to modify the request before it is sent, not after.
          How can I use this class to read response headers?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Devoo
          Yes, I see what you mean. That title Capture server response with QWebEngineView looks good, but I agree the answer seems to be only for request, not response. I don't see anything equivalent for the response, so I don't know... And I think you have asked the same in a comment at stackoverflow :)

          1 Reply Last reply
          0
          • KH-219DesignK Offline
            KH-219DesignK Offline
            KH-219Design
            wrote on last edited by
            #5

            I do not properly know the answer. However, reading this question piqued my curiosity, so I started down the path of trying to find an answer...

            I have to stop my inquiry for today, but here is where I got...

            There is a class inside namespace QtWebEngineCore named DevToolsFrontendQt, and this class seems to do some processing/handling of things of type HttpResponseHeaders.

            So, Qt webengine (which is based on Chromium) does seem to include some kind of DevTools UI.

            https://doc.qt.io/qt-5/qtwebengine-debugging.html#qt-webengine-developer-tools

            https://github.com/qt/qtwebengine/blob/cd12379d43/src/core/devtools_frontend_qt.h#L72

            https://stackoverflow.com/questions/28681141/qtwebengine-debugging

            Technically, this "Dev Tools" presence arguably constitutes some kind of "yes" answer to "Is there any way to get response headers?"

            .... but probably not in the way you mean. If you only need to see the headers for debugging, then this could be acceptable. But I suspect you wish to intercept the headers programmatically as a built-in feature of your final application. If Qt has not yet exposed any end-user API for doing that in your application, then grepping the "qt/qtwebengine" source code for "HttpResponseHeaders" might suggest a way to hack into qtwebengine and make a custom build of it that exposes what you need. No doubt this would be a significant engineering effort.

            www.219design.com
            Software | Electrical | Mechanical | Product Design

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved