Thanks Jason,
I knew it would be simple.  Thank you so much.

Regards
Damien

On 10/01/2010, at 2:35 PM, Jason Foreman wrote:

> 
> On Jan 9, 2010, at 9:31 PM, Damien Cooke wrote:
> 
>> here is my code to send this data
>> 
> 
>>      [appendedData appendData:[[[NSString 
>> stringWithFormat:@"ProdName=%@",[self applicationName]] 
>> stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding] 
>> dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]];
>>      [appendedData appendData:[[[NSString 
>> stringWithFormat:@"ProdVersion=%@",[self productVersion]] 
>> stringByAddingPercentEscapesUsingEncoding: 
>> NSASCIIStringEncoding]dataUsingEncoding:NSASCIIStringEncoding 
>> allowLossyConversion:YES]];
> 
> Review the info for the application/x-www-form-urlencoded Form content type 
> here: <http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4>
> 
> In brief, you aren't separating your form variables with an "&" character.
> 
> You're doing this:
> 
>       "ProdName=FooProdVersion=Bar"
> 
> whereas you want this:
> 
>       "ProdName=Foo&ProdVersion=Bar"
> 
> 
> 
>>      NSString *dataLength = [[NSString alloc] initWithFormat:@"%d", 
>> [appendedData length]];
> 
>>      [request setValue:dataLength forHTTPHeaderField:@"Content-Length"];
> 
> I believe this is unnecessary, as it will be calculated automatically from 
> the data passed to -setHTTPBody.
> 
> 
> Regards,
> 
> Jason
> 
> 

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to