AFOnoResponseSerializer is an XML and HTML response serializer for AFNetworking 2.0, using Ono.
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFOnoResponseSerializer XMLResponseSerializer];
[manager GET:@"http://example.com/foo.xml" parameters:nil success:^(AFHTTPRequestOperation *operation, ONOXMLDocument *responseDocument) {
for (ONOXMLElement *element in [responseDocument XPath:@"//item"]) {
NSLog(@"%@", element);
}
} failure:nil];AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFOnoResponseSerializer HTMLResponseSerializer];
[manager GET:@"http://example.com/bar.html" parameters:nil success:^(AFHTTPRequestOperation *operation, ONOXMLDocument *responseDocument) {
for (ONOXMLElement *element in [responseDocument CSS:@"body ul li"]) {
NSLog(@"%@", element);
}
} failure:nil];Mattt Thompson
- http://github.com/mattt
- http://twitter.com/mattt
- [email protected]
AFOnoResponseSerializer is available under the MIT license. See the LICENSE file for more info.