AFNetworking framework Request failed: unacceptable content-type: text/plain問題

 

    // 初始化Manager

    AFURLSessionManager *manager = [[AFURLSessionManageralloc] initWithSessionConfiguration:[NSURLSessionConfigurationdefaultSessionConfiguration]];

    NSProgress *progress = nil;

 

    // 加入可接愛Server吐回來的資料型態

    AFHTTPResponseSerializer *responseSerializer = manager.responseSerializer;

    responseSerializer.acceptableContentTypes = [NSSetsetWithObject:@"text/plain"];

 

參考資料:

https://github.com/AFNetworking/AFNetworking

http://stackoverflow.com/questions/19114623/request-failed-unacceptable-content-type-text-html-using-afnetworking-2-0

http://stackoverflow.com/questions/12626748/what-is-the-correct-way-of-sending-large-file-through-http-post-without-loading

http://docs.valence.desire2learn.com/basic/fileupload.html

http://stackoverflow.com/questions/6604462/uploading-or-exporting-a-large-video-sucks-memory-and-causes-crash-how-can-i-b

    全站熱搜

    小賢 發表在 痞客邦 留言(0) 人氣()