AFgzipRequestSerializer 0.0.2

AFgzipRequestSerializer 0.0.2

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

Maintained by Mattt, Kevin Harwood.


Downloads

Total992,522
Week0
Month0

Installs

Apps1,455
Test Targets254
Watch Apps6
powered by Segment

GitHub

Stars146
Watchers8
Forks33
Issues4
Contributors4
Pull Requests4

Code

Files2
LOCLines of Code 66


 
Depends on:
AFNetworking~> 2.0
Godzippa~> 1.0
 

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.