Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Intercepting WebKit network requests

Intercepting WebKit network requests

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 940 Views
  • 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.
  • E Offline
    E Offline
    efian
    wrote on last edited by
    #1

    TLDR; is there a good example which shows making asynchronous requests in a custom NetworkAccessManager ::createRequest function and responding only once the data is loaded?

    I have a web application that I would like to provide an offline version of. To do this I took my SPA app and wrapped it in a QT application. To make the ajax calls work I had to provide a custom network access manager.

    This all works beautifully except for one ajax call I make that actually has to make a web request. The rest simply load or save files.

    In my custom NAM ::createRequest function I return an incomplete QNetworkReply that is open for read. The readData function calls processEvents and returns -1 until I asynchronously receive data from the web request. At that point I populate the QNetworkRequest, fire the readyRead/complete events and let it go.

    The problem I am having is this leads to a 404 in Webkit and the data is not received even though as best I can tell it has been read from the QIODevice interface to the request.

    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