Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get NSData straight from AFNetworking, rather than letting it convert to UIImage

Is there a flag that would let me get NSData, rather than let AFNetworking convert my responseData into the corresponding data type(UIImage, NSString)?

like image 264
SirRupertIII Avatar asked Jul 15 '14 22:07

SirRupertIII


1 Answers

The AFHTTPResponseSerializer will return the raw NSData:

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];

    [manager GET:... parameters:... 
         success:^(AFHTTPRequestOperation *operation, NSData *responseObject) {} 
         failure:...];
like image 150
David Snabel-Caunt Avatar answered Sep 23 '22 20:09

David Snabel-Caunt