I am trying to POST some data to the server with body formatted as XML.
[[HttpClientXML sharedClientWithBaseUrl:self.baseUrl] POST:@"/postXml/" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
BSLog(@"Success");
} failure:^(NSURLSessionDataTask *task, NSError *error) {
BSLog(@"Error: %@",error.localizedDescription);
}];
POST body xml content looks smth. like that:
<action name='job'>jobName</action>
HttpClientXML has this definitions:
self.responseSerializer = [AFXMLParserResponseSerializer serializer];
self.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/xml"];
In version 1.x this was doable with AFXMLRequestOperation
. But in version 2.x I can not get the working solution with AFHTTPSessionManager
.
Any suggestions?