I have the following code when I want to make a call to the server:
let mutableURLRequest = NSMutableURLRequest(url: URL)
mutableURLRequest.httpMethod = "POST"
let parameters = ["SessionID": sessionID]
do {
mutableURLRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: JSONSerialization.WritingOptions())
} catch {}
mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
Alamofire.request(**mutableURLRequest**).responseJSON{
response in if let JSON = response.result.value{}}
Where text is BOLD is giving me error in this variable
Argument type 'NSMutableURLRequest' does not conform to expected type 'URLRequestConvertible'
however give me the following option
Fix-it Insert as! URLRequestConvertible
If I accept the suggestion it is put into the code what they say but the error persists and says to insert again and it is infinitely.
Does anyone know how to solve this problem?