These days in the picture upload, encountered a problem, that is, as long as I append the picture will request time-out, the following is the code:
Afhttprequestoperationmanager *manager = [Afhttprequestoperationmanager manager]; Manager.responseSerializer.acceptableContentTypes = [Nsset setwithobject:@ "text/html"]; Nsurl *filepath = [Nsurl urlwithstring:[nsstring stringwithformat:@ "file://%@", FullPath]]; [Manager Post:url Parameters:nil constructingbodywithblock:^ (id<afmultipartformdata> formData) { [formData appendpartwithfileurl:filepath name:@ "image" Error:nil]; } success:^ (afhttprequestoperation *operation, id responseobject) { } failure:^ (Afhttprequestoperation *operation, Nserror *error) { }];
Because I have other data on my side besides uploading pictures, I use Afnetworking's post multi-part request for data submission. Encountered the problem is: as long as not upload pictures There is no problem, I add append ... Will request time-out, and later updated a bit afnetworking on OK, very strange, perhaps the reason for iOS8 it!
https://github.com/AFNetworking/AFNetworking/
You are welcome to criticize and correct me!
afnetworking POST multi-part Request upload image