Hey so I have a website that has documentation to POST up information to it. The documentation telling how to post. Comes in a form like this.
Code From Documentation:
curl -X POST "https://api/management/user" \
-d "user_id=myuserid" \
-d "client=clientclientclient" \
-d "secret=secretsecret"
I'm not sure how to write that out in a swift string.
Code:
let string = "https://api/management/user/user_id=myuserid/client=clientclientclient/secret=secretsecret"
Then I can do something like this.
Code:
let url = NSURL(string: string)
let request = NSMutableURLRequest(url: url! as URL)
request.httpMethod = "POST"
let session = URLSession.shared
let tache = session.dataTask(with: request as URLRequest) { (data, response, error) -> Void in
print(data!)
print(response!)
}
tache.resume()
Im NEW to this So what would be the proper way to write the post.