I'm using AFNetworking framework and need to submit a form (POST) request to the server. Here's a sample of what server expects:
<form id="form1" method="post" action="http://www.whereq.com:8079/answer.m">
<input type="hidden" name="paperid" value="6">
<input type="radio" name="q77" value="1">
<input type="radio" name="q77" value="2">
<input type="text" name="q80">
</form>
I consider using the multipartFormRequestWithMethod in AFHTTPClient, just like what was discussed in post Sending more than one image with AFNetworking. But I have no idea about how to append the form data with "radio" type input value.
If you take a look at what the browser submits to the server when using this form (using the debug panel in your browser) you'd see that your POST request data looks like this:
That is the value entry from the selected radio button is used as the value for the corresponding POST entry, and you get just one entry for all of the radio buttons. (As opposed to toggle buttons, where you get a value for each that is currently selected.)
Once you understand the format of the POST string you should be able to create the request in the usual manner using ASIFormDataRequest.
Here is how to do with STHTTPRequest
Here's an example using NSURLConnection to send POST parameters: