Hi Cochise,
I have an answer and a question for everyone.
If you derive a class from QWebPage and add your own acceptNavigationRequest like this
class MyWebPage : public QWebPage
{
public:
protected:
virtual bool acceptNavigationRequest ( QWebFrame * frame, const QNetworkRequest & request, NavigationType type );
};
class MyWebPage : public QWebPage
{
public:
MyWebPage(QObject *p_parent = 0);
protected:
virtual bool acceptNavigationRequest ( QWebFrame * frame, const QNetworkRequest & request, NavigationType type );
};
To copy to clipboard, switch view to plain text mode
Then when the user submits a form acceptNavigationRequest will be called with type set to NavigationTypeFormSubmitted.
If you look in the QNetworkRequest you should be able to find the URL and other information relating to the form submission.
Now, here is my question. The request object will have headers, url etc but I can't get the POST information which is in the body of the HTTP request.
This works fine for GET form submissions as the form key/value pairs are encoded in the URL and available via request.url().encodedQueryItems()
Sooo... How do I get to the body information in the QNetworkRequest from an HTML "POST" form submission.
Yours,
Matthew.
Bookmarks