因為上傳使用的是AFURLSessionManager 页屠,而AFURLSessionManager默認的responseSerializer是AFURLResponseSerialization卓鹿,而AFURLResponseSerialization默認是AFJSONResponseSerializer的一個實例,而AFJSONResponseSerializer不支持text/html。
解決方法:重新替換responseSerializer
AFHTTPResponseSerializer *responseSerializer = [AFHTTPResponseSerializer serializer];
responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", nil];
manager.responseSerializer = responseSerializer;