Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

An XML and HTML response serializer for AFNetworking 2.0, using Ono

License

Notifications You must be signed in to change notification settings

AFNetworking/AFOnoResponseSerializer

Repository files navigation

AFOnoResponseSerializer

AFOnoResponseSerializer is an XML and HTML response serializer for AFNetworking 2.0, using Ono.

Usage

XML

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];

HTML

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];

Contact

Mattt Thompson

License

AFOnoResponseSerializer is available under the MIT license. See the LICENSE file for more info.

About

An XML and HTML response serializer for AFNetworking 2.0, using Ono

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •