I am doing a request operation to download every types of files from a server with AFHTTPRequestOperationManager.
At the moment, I am doing like this:
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"image/jpeg", @"image/gif", @"image/png", @"application/pdf", ..., nil];
It is working nicely, but I would like to enable all content types possible to avoid missing some.
Is it possible to initiate the acceptable content types for every kind of existing content? Something like:
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"*", nil];
Thank you.
just set acceptableContentTypes to nil.
the relevant code in AFNetworking looks like:
if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]]) {
...
if acceptableContentTypes is nil, then it doesn't bother checking, and just carries on downloading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With