I used swiftyJSON in my project when i use php created API it works fine in project but when i used C# Created API in my project it gives null in response. I Searched on net and I got you can use it in your project.
Here is code
let url: NSURL = NSURL(string: "http://compareit.unitechecom.com/AndroidClass/API/login.aspx?Mobile_Number=8523697888&Password=123")! // Enter URL Here
let request:NSMutableURLRequest = NSMutableURLRequest(url:url as URL)
//let bodyData = "employeeVerify & employeeID=\(empID)"// Pass parameter Form Here.
// print(bodyData)
request.httpMethod = "GET"
//request.HTTPBody = bodyData.dataUsingEncoding(NSUTF8StringEncoding);
print(request)
let task = URLSession.shared.dataTask(with: request as URLRequest)
{
data, response, error in
if error != nil
{
print("error=\(error)")
return
}
// You can print out response object
print("response = \(response)")
do {
let json = JSON(data: data!)
print(json)
}
}
task.resume()
what is the solution for this.? Can i use it.?