skip to Main Content

Ios swift – Parse Bool response using Alamofire

I have old code from team where they were failing to parse Bool response. NetworkManager.shared().executeWith(request: APIRouter.firebasetoken(param)) { (httpResponse, jsonData, error) in if httpResponse?.statusCode == 200 { guard let json = jsonData else {return} if let isSuccess = json.bool, isSuccess ==…

VIEW QUESTION

JSONDecoder returning nil while parsing

I have the following function: func executeGet( completion: @escaping (Data?, Error?) -> Void) { AF.request("https:URL", method:.get, headers:headers).response{ response in debugPrint(response) if let error = response.error { completion(nil, error) } else if let jsonArray = response.value as? Data{ completion(jsonArray, nil) }…

VIEW QUESTION

Alamofire post request getting **Invalid value around line 1, column 0.** – Ios swift

I am trying to hit alamofire post request but, Getting Request failed with error responseSerializationFailed ( reason: Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed ( error: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around line 1, column 0." UserInfo={NSDebugDescription=Invalid value around line 1, column 0., NSJSONSerializationErrorIndex=0})). Please help…

VIEW QUESTION
Back To Top
Search