0

Hi I'm trying to write AFNetworking 3.x post request with xml body and receive xml from server (because server accept xml input and out put xml). I've done successful with JSON but have problem with xml.

How to modify these template to send xml body and receive xml response. and what library should we use to parse the xml response? Any help is much appreciate. Thanks

NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];

NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/get"];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];

NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {     
    if (error) {  
        NSLog(@"Error: %@", error);
    } else {     
        NSLog(@"%@ %@", response, responseObject);  
    }   
}];
[dataTask resume];
Ekta Padaliya
  • 5,743
  • 3
  • 39
  • 51
Lê Khánh Vinh
  • 2,591
  • 5
  • 31
  • 77

1 Answers1

-2

this is a link with the answer that you are looking for .

Try this

H@ppy c0de !!

Community
  • 1
  • 1
MedAmine.Rihane
  • 1,193
  • 10
  • 17