AFOnoResponseSerializer 1.0.0

AFOnoResponseSerializer 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2015

Maintained by Mattt Thompson, Kevin Harwood.


Downloads

Total79,368
Week132
Month833

Installs

Apps1,007
Apps WeekApps This Week 9
Test Targets51
Test WeekTests This week 1
Watch Apps1
powered by Segment

GitHub

Stars116
Watchers2
Forks21
Issues3
Contributors4
Pull Requests2

Code

Files2
LOCLines of Code 100


 
Depends on:
AFNetworking~> 2.2
Ono~> 1.0
 

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:^(NSHTTPURLResponse *response, 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:^(NSHTTPURLResponse *response, 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.