Я долго пытался понять, в чем проблема, но получаю ту же ошибку
let urlString = "https://api.github.com/user?access_token=\(token!)"
let name = nameEditField.text!
let blog = blogEditField.text!
let company = companyEditField.text!
let bio = bioEditField.text!
let location = locationEditField.text!
let parameters: [String:Any] = ["name": name, "blog": blog, "company": company, "location": location, "bio": bio]
let headers = ["accept": "application/vnd.github.v3+json"]
request(urlString, method: .patch, parameters: parameters, headers: headers).validate().responseJSON { responseJSON in
print(responseJSON)
switch responseJSON.result {
case .success(let value):
guard
let jsonObject = value as? String
else { return }
print(jsonObject)
case .failure(let error):
print(error)
}
Response: FAILURE: responseValidationFailed (причина: Alamofire.AFError.ResponseValidationFailureReason.unacceptableStatusCode ( код: 404))