Для метода Get ... Пример отправки текста
NSURL * serviceUrl = [NSURL URLWithString:@"http://.......url"];
NSMutableURLRequest * serviceRequest = [NSMutableURLRequest requestWithURL:serviceUrl];
[serviceRequest setValue:@"text" forHTTPHeaderField:@"Content-type"];
[serviceRequest setHTTPMethod:@"GET"];
[serviceRequest setValue:@"asd" forHTTPHeaderField:@"username"];
[serviceRequest setValue:@"asd" forHTTPHeaderField:@"password"];
//Get Responce hear----------------------
NSURLResponse *response;
NSError *error;
NSData *urlData=[NSURLConnection sendSynchronousRequest:serviceRequest returningResponse:&response error:&error];
NSString *strdata=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"%@",strdata);
Для метода Post .... Отправка XML-примера
NSString * xmlString = @"<Envelope><Body>............</Body></Envelop";
NSURL * serviceUrl = [NSURL URLWithString:@"http://...............url"];
NSMutableURLRequest * serviceRequest = [NSMutableURLRequest requestWithURL:serviceUrl];
[serviceRequest setValue:@"text/xml" forHTTPHeaderField:@"Content-type"];
[serviceRequest setHTTPMethod:@"POST"];
[serviceRequest setHTTPBody:[xmlString dataUsingEncoding:NSASCIIStringEncoding]];
// response hear-----------------
NSURLResponse *response;
NSError *error;
NSData *urlData=[NSURLConnection sendSynchronousRequest:serviceRequest returningResponse:&response error:&error];
NSString *strdata=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"%@",strdata);