Reputation:
This is the culprit string and paramter name=solsssㅗ
Alamofire.request(todoEndpoint)
.responseJSON { response in
// check for errors
guard response.result.error == nil else {
// got an error in getting the data, need to handle it
print("error calling GET on \(todoEndpoint)")
print(response.result.error!)
DispatchQueue.main.async
{
self.activityView.isHidden = true
self.activityView.stopAnimating()
}
return
}
So I get error in URL always as invalid. If I use it without any special character it works fine.
Upvotes: 0
Views: 314
Reputation: 1058
You can try this with String url -
let urlWithSpecialCharacter = url.addingPercentEncoding( withAllowedCharacters: .urlQueryAllowed)
Upvotes: 1