SkillAgentSearch skills...

AFOnoResponseSerializer

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

Install / Use

/learn @AFNetworking/AFOnoResponseSerializer
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

  • http://github.com/mattt
  • http://twitter.com/mattt
  • m@mattt.me

License

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

Related Skills

View on GitHub
GitHub Stars113
CategoryDevelopment
Updated2y ago
Forks23

Languages

Objective-C

Security Score

80/100

Audited on Feb 15, 2024

No findings