Thanks, Conrad. That's a start but given the values that I have to provide back 
to the server, the sample example didn't help much. I've tried a few variations 
to set the content of the request's body but the server always return a 400 
(bad request). So, I'm guessing that I'm not providing the server with what it 
expects…

In my example, I need to provide a first name value, a last name value and a 
password value. The NSURLRequest has to be a POST but how do I provide those 
values as part of the request?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin                                 
http://www.nemesys-soft.com/
Logiciels Nemesys Software                                              
laur...@nemesys-soft.com

On Nov 10, 2010, at 16:03, Conrad Shultz wrote:

> On 11/10/10 3:10 PM, Laurent Daudelin wrote:
>> Hello all.
>> 
>> I'm downloading a web page that contains a form with NSURLConnection. The 
>> form contains a few fields that I can fill with values. 
>> Here is the form part:
>> 
>> <form id="loginform" action="/openid/loginsubmit" method="post" 
>> style="position:relative; style="position:relative;"">
> ...
>> Now, how would I submit it back to the server?
> 
> You're basically asking how to send a POST request back to the server
> ('method="post"').
> 
> See, e.g.,
> http://www.conceitedcode.com/2010/06/sending-post-data-using-nsurlconnection/
> 
> I should point out, though, that this approach is fragile - particularly
> if the remote site is not one you control.  If the site changes its form
> structure (particularly, field names) things will suddenly break.  Best
> to use a published web API if available.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to