小编OvR*_*ose的帖子

[Swift,Alamofire]:responseValidationFailed,错误代码为400

我的问题基本上在标题中.我试图运行的代码就在下面.VVV

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)

        }

    })
Run Code Online (Sandbox Code Playgroud)

我收到的确切控制台错误是: responseValidationFailed(Alamofire.AFError.ResponseValidationFailureReason.unacceptableStatusCode(400))

我顺便使用Instagram API,但我认为这不一定与问题有关.

任何帮助非常感谢.

post instagram swift alamofire

6
推荐指数
1
解决办法
7543
查看次数

标签 统计

alamofire ×1

instagram ×1

post ×1

swift ×1