I have a QWebView component in my Qt widget application. And I have already created a network manager to handle requests from the QWebView.
我在Qt小部件应用程序中有一个QWebView组件。我已经创建了一个网络管理器来处理来自QWebView的请求。
What I want to do is catching the values of the web form inside QWebView, up to this point of time I have the QNetworkRequest instance of every network request.
我想要做的是在QWebView中捕捉web表单的值,直到现在我有每个网络请求的QNetworkRequest实例。
How to extract the form values from the QNetworkRequest instance?
如何从QNetworkRequest实例提取表单值?
2 个解决方案
#1
1
You can use this function of QNetworkRequest
class:
您可以使用QNetworkRequest类的这个函数:
QByteArray QNetworkRequest::rawHeader ( const QByteArray & headerName ) const
which returns the raw form of header named headerName
.
它返回标题为headerName的原始表单。
#2
1
Are you talking about the values on the get method?
你是在说get方法上的值吗?
int i= 0;
QPair<QString , QString > values;
while( i < ui->webView->url().queryItems().count() )
{
values = ui->webView->url().queryItems().at( i );
i++;
}
#1
1
You can use this function of QNetworkRequest
class:
您可以使用QNetworkRequest类的这个函数:
QByteArray QNetworkRequest::rawHeader ( const QByteArray & headerName ) const
which returns the raw form of header named headerName
.
它返回标题为headerName的原始表单。
#2
1
Are you talking about the values on the get method?
你是在说get方法上的值吗?
int i= 0;
QPair<QString , QString > values;
while( i < ui->webView->url().queryItems().count() )
{
values = ui->webView->url().queryItems().at( i );
i++;
}