PDA

View Full Version : QNetworkAccessManager:How to post multiple values of the same name ?



hxcan
17th April 2012, 07:31
For example:
<form action="a.asp">
<input name="bookcount" value="2" />
<input name="bookcount" value="4" />
<input type="submit" value="submit" />
</form>

I have multiple input in the form with the same name "bookcount" .
In firefox , I can successfully post them and got all of the values at the server side ( request.form("bookcount")(i) ).

But how can I post them using QNetworkAccessManager ? How to build the post data that can be processed by my server-side script ?

mentalmushroom
18th April 2012, 08:47
Construct a network request, specifying URL where to sent, set "Content-Type" header and post it along with your data with QNetworkAccessManager::post method.