我收到代码错误**状态代码:400 *
URL: https://conversation.8villages.com/1.0/contents/articles?state=published }
{ status code: 400, headers {
Connection = "keep-alive";
"Content-Length" = 2;
"Content-Type" = "application/json";
Date = "Tue, 11 Apr 2017 07:49:13 GMT";
Server = nginx;
} }
2 bytes
SUCCESS
JSON: {
}
我的json是结果SUCCESS但是没有显示我的DATA?
实际上我得到了消费者密钥,消费者秘密,令牌密钥和令牌密钥的请求方法Alamofire。像这样:
let params: HTTPHeaders = ["oauth_consumer_key":"*****",
"oauth_consumer_secret":"*****",
"oauth_token_key":"*****.",
"oauth_token_secret": "*****",
"oauth_signature_method": "HMAC-SHA1",
"oauth_timestamp_key" : "1491366048",
"oauth_version": "1.0"] as [String : Any] as! HTTPHeaders;
Alamofire.request("https://conversation.8villages.com/1.0/contents/articles?state=published", method: .get, headers: params).responseJSON { response in
print("test", response.request!) // original URL request
print("ini responseny", response.response!) // HTTP URL response
print("test", response.data!) // server data
print("test", response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
如何获取我的数据API ??
答案 0 :(得分:0)