zoukankan      html  css  js  c++  java
  • 微博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) { 
    }];

    如果是授权失败

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

  • 相关阅读:
    一个简单的window.onscroll实例
    vue 自定义组件使用v-model
    vue开发后台管理系统有感
    cube打包后css顺序错误
    app嵌套的vue项目更新后,页面没有更新
    vue打包后css背景图片地址找不到
    git取消操作命令
    cube-ui indexList的正确使用
    首次db查询时延迟明显高于后面几次。
    git中的merge与rebase
  • 原文地址:https://www.cnblogs.com/zhuzhushen/p/4227118.html
Copyright © 2011-2022 走看看