I am receiving a
base64Stringfor Image in response of an Api but unable to get the result throughAlamofire.requestmethod (tried with get as well as post).Alamofire.request(ApiUrl, method: .get, parameters: [:] , encoding:JSONEncoding.default, headers:kAuthorizationHeader).responseString { (response) in switch response.result { case .success(let responseString): if let imageData = Data(base64Encoded: responseString), let image = UIImage(data: imageData) { print("image") } case .failure(let error): print("\(error.localizedDescription)") } }It always returns a failure with 'requestTimeOut' in case of get method and 'Invalid value around character 0' for post.
Is there any way through which we can get the
base64Stringso that I can convert the same toUIImage? Please advise.