let unfollow = "https://API.instagram.com/v1/users/\(userID)/relationship?access_token=\(access_token)&action=unfollow" Alamofire.request(unfollow,method: .post).valIDate().responseJsON(completionHandler: { response in switch response.result { case .success(let value): let data = JsON(value)["data"] print(data["outgoing_status"].stringValue) case .failure(let error): print(error) } })
我收到的确切控制台错误是:responseValIDationFailed(Alamofire.AFError.ResponseValIDationFailureReason.unacceptableStatusCode(400))
我顺便使用Instagram API,但我认为这不一定与问题有关.
任何帮助非常感谢.
解决方法 错误日志responseValIDationFailed(Alamofire.AFError.ResponseValIDationFailureReason.unacceptableStatusCode(400))清楚地表明您收到400错误.这在 W3.org中解释为400 Bad Request:
The request Could not be understood by the server due to malformed Syntax. The clIEnt SHOulD NOT repeat the request without modifications.
因此,如果正确,您需要请求URL请求URL.
此外,您正在使用请求的valIDate()方法,该方法应该获得响应状态代码200 … 299,但您将获得400作为响应代码.这就是为什么它在错误日志中被提及为不可接受的StatusCode(400).
Seel this也.
总结以上是内存溢出为你收集整理的[Swift,Alamofire]:responseValidationFailed,错误代码为400全部内容,希望文章能够帮你解决[Swift,Alamofire]:responseValidationFailed,错误代码为400所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)