Skip navigation.
 
mlRe: Problems with NSURLRequest and HTTP POST Form Data
FROM : Christopher Bland
DATE : Tue Jun 13 23:38:26 2006

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!

Related mailsAuthorDate
mlProblems with NSURLRequest and HTTP POST Form Data Brant Sears Jun 13, 22:48
mlRe: Problems with NSURLRequest and HTTP POST Form Data Christopher Bland Jun 13, 23:38
mlRe: Problems with NSURLRequest and HTTP POST Form Data Conor Dearden Jun 14, 10:06