Hi everybody, I'm making a little app that make a login on a mysql database, using a php page.
when the application return from the php page I take this error:
Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
On the php page, I write some logs and it seems that there is no problem on php page.
I'm using xcode 8 and swift 3.
this is the code of the application:
/
let request = NSMutableURLRequest(url: url as URL)
let username = txtusername.text!
let password = txtpassword.text!
let body = "username=\(username)&password=\(password)"
request.httpBody = body.data(using: .utf8)
DispatchQueue.main.async(execute: {
guard let parseJSON = json else {
print ("catch an error: \(error)")
Thanks in advance for your help.
Regards.
Angelo.