Capture http request before sending with QtWebkit framework
I am trying to write something similar to the http package viewer of the chrome developer tool. I want to use a QWebView to load some Url, and if I click any link on that web page (or submit a form), my program can print the http package I just sent (http header, cookies and form data).
I checked the document for webview, webpage, webframe and also networkmanager. But I couldn't find a signal which is emitted just before sending the request. I am wondering if there is an easy way to do this, or must I change the QWebkit framework myself?
Thank you very much.
You can subclass QNetworkAccessManager and reimplement createRequest to do that (Just do your logging and then fallback to the parent function).