Re: Problems with NSURLRequest and HTTP POST Form Data
Re: Problems with NSURLRequest and HTTP POST Form Data
- Subject: Re: Problems with NSURLRequest and HTTP POST Form Data
- From: "Christopher Bland" <email@hidden>
- Date: Tue, 13 Jun 2006 21:38:26 GMT
I've seen some working code that used this code:
- (void)transmitXMLRequest:(NSData *)data
{
NSURL *webServiceURL = [NSURL
URLWithString:@"http://test.com/xmlResponder"];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest
requestWithURL:webServiceURL];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"text/xml" forHTTPHeaderField:@"Content-type"];
[urlRequest setHTTPBody:data];
NSURLConnection *connectionResponse = [[NSURLConnection alloc]
initWithRequest:urlRequest delegate:self];
if (!connectionResponse) {
NSLog(@"Failed to submit request");
} else {
NSLog(@"Request submitted");
responseData = [[NSMutableData alloc] init];
}
}
Hope that helps you out.
Chris
________________________________________________________________________
Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 1GB of Email Storage.
Visit http://www.juno.com/value to sign up today!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden