È possibile HTTP POST-IT:
NSString * xmlString = @"<test><message length="5">Hello</message></test>";
NSURL * serviceUrl = [NSURL URLWithString:@"http://my.company.com/myservice"];
NSMutableURLRequest * serviceRequest = [NSMutableURLRequest requestWithURL:serviceUrl];
[serviceRequest setValue:@"text/xml" forHTTPHeaderField:@"Content-type"];
[serviceRequest setHTTPMethod:@"POST"];
[serviceRequest setHTTPBody:[xmlString dataUsingEncoding:NSASCIIStringEncoding]];
NSURLResponse * serviceResponse;
NSError * serviceError;
serviceResponse = [NSURLConnection sendSynchronousRequest:serviceRequest returningResponse:&serviceResponse error:&serviceError];
è anche possibile impostare altri Header HTTP come Content-Length allo stesso modo.
Spero che questo aiuti,
sendSynchronousRequest: returningResponse: errore: restituisce un oggetto NSData e non il NSURLResponse hai usato. –
Grazie, è bello ... grazie mille – sinh99