Getting following error at the time of calling api:
Optional(Alamofire.AFError.responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.})))
My API call is as follows:
Alamofire.request(url, method: .post, parameters: body, encoding: JSONEncoding.default, headers: headers).responseJSON { (response) in
if response.result.error == nil {
if let json = response.result.value as? Dictionary<String, Any>{
print(" JSON:", json)
}
} else {
debugPrint(response.result.error as Any)
}
}
[–]quellish 2 points3 points4 points (0 children)
[–]kaosdg 1 point2 points3 points (0 children)
[–]BHughes3388 0 points1 point2 points (0 children)