Re: "So I want to connect to the internet in 2008..."
Re: "So I want to connect to the internet in 2008..."
- Subject: Re: "So I want to connect to the internet in 2008..."
- From: Jens Alfke <email@hidden>
- Date: Mon, 23 Jun 2008 10:03:30 -0700
On 23 Jun '08, at 8:06 AM, JP May wrote:
To be clear, one has to "roll-your-own" content-length.
No. NSURLRequest will set the Content-Length header for you.
Indeed, one would of have to roll-your-own body, i.e., appropriately
encoding and adding together your form elements.
Correct. There is no built-in support for the standard form encoding
format. This is probably because Cocoa is rarely if ever used to
implement server-side CGIs; and these days, most client-side
programmatic access to web services is done using interfaces like REST
or XML-RPC that don't require the client to pretend to be an HTML form.
That said, it's really easy to generate the right output. Looks like
you already know the format. To do the correct encoding of the string
contents you'll need to call [paramString
stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding].
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden