微博API

 

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) { 
}];

如果是授权失败

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

 

转载于:https://www.cnblogs.com/zhuzhushen/p/4227118.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值