码迷,mamicode.com
首页 > Windows程序 > 详细

微博API

时间:2015-01-15 20:16:18      阅读:288      评论:0      收藏:0      [点我收藏+]

标签:

 

Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/plain" UserInfo=0xa053d90 {com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0xa073260> { URL: https://api.weibo.com/oauth2/access_token } { status code: 200, headers {

    "Api-Server-IP" = "10.75.2.82";

    "Cache-Control" = "no-cache";

    Connection = "keep-alive";

    "Content-Length" = 117;

    "Content-Type" = "text/plain;charset=UTF-8";

    Date = "Thu, 15 Jan 2015 11:16:25 GMT";

    Expires = "Thu, 01 Jan 1970 00:00:00 GMT";

    Pragma = "No-cache";

    Server = "nginx/1.6.1";

} }, NSErrorFailingURLKey=https://api.weibo.com/oauth2/access_token, NSLocalizedDescription=Request failed: unacceptable content-type: text/plain, com.alamofire.serialization.response.error.data=<7b226163 63657373 5f746f6b 656e223a 22322e30 30576355 34334434 415f336b 44613438 63663032 39313130 7747655f 7a222c22 72656d69 6e645f69 6e223a22 31353736 37393939 39222c22 65787069 7265735f 696e223a 31353736 37393939 392c2275 6964223a 22333037 39303737 31343022 7d>}

 

你可以用AFHTTPRequestOperationManager解决一切问题,遇到你的这个问题,你可以像这么写: 
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];//设置相应内容类型 
[manager POST:url parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { 
} failure:^(AFHTTPRequestOperation *operation, NSError *error) { 
}];

如果是授权失败

回调网址与授权网址不应该是一致的

 

微博API

标签:

原文地址:http://www.cnblogs.com/zhuzhushen/p/4227118.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!