Skip to content

Anislav/AFgzipRequestSerializer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AFgzipRequestSerializer

AFgzipRequestSerializer applies gzip compression to requests generated by a specified serializer, setting the appropriate Content-Encoding header.

Example Usage

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.requestSerializer = [AFgzipRequestSerializer serializerWithSerializer:[AFJSONRequestSerializer serializer]];

NSDictionary *parameters = ;
[manager POST:@"http://example.com/"
   parameters:@{@"foo": "bar"}
      success:^(NSURLSessionDataTask *task, id responseObject) {
        NSLog(@"%@", responseObject);
}
      failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"[Error] %@", error);
}];
    POST http://example.com/

    Accept-Content: application/json
    Content-Type: application/json
    Content-Encoding: gzip

    (gzip-compressed JSON)

Contact

Mattt Thompson

License

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

About

gzip Request Serializer for AFNetworking

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 89.3%
  • Ruby 10.7%