I am having a hard time sifting through search results for how to do this and I can't find anything concrete in the documentation. I just want to download a file and store in the Documents directory. The file is of type .plist, but I don't need to parse the plist. Like I said I just need to save it to disk.
Do I use AFHTTPRequestOperationManager for this?
This is what I've been trying in general:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
//manager.responseSerializer = [AFPropertyListResponseSerializer serializer];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
[manager GET:url parameters:nil
success:^(AFHTTPRequestOperation *operation, id responseObject) {
DLog(@"downloaded plist");
}
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
DLog(@"JSON DataError: %@", error);
}];
If I use AFHTTPResponseSerializer I get this:
Error Domain=AFNetworkingErrorDomain Code=-1011 "Request failed: internal server error (500)"
If I use AFPropertyListResponseSerializer I get this:
Error Domain=AFNetworkingErrorDomain Code=-1016 "Request failed: unacceptable content-type: text/plain"
But I'm not even sure I'm using the correct API.