gowalla/AFNetworking — Issue #82: AFHTTPRequestOperation seems to silently do nothing
Author: ericflo
Created: 2011-10-19 19:11:00+00:00
State: open

In my use of AFNetworking I want to do both requests for JSON content and also data downloads. Looking through the code it seems that things default to AFHTTPRequestOperation if there's no accept header for JSON or XML, so I thought that would be good. But I couldn't figure out why it wasn't making the requests, and I was getting back nil. Then I saw this:

+ (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)urlRequest
success:(void (^)(id object))success
failure:(void (^)(NSHTTPURLResponse *response, NSError *error))failure
{
return nil;
}

Maybe I'm missing something, but I don't understand why this would be the implementation. Why not pass the NSData to the success block? Or, if not making the request is the intended behavior, then some sort of console output saying why. Surely I'm confused.