I'm approaching iOS development and I'd like to have one of my first applications to perform a HTTP POST request.
As far as I can understand, I should manage the connection which handles the request via a NSURLConnection
object, which forces me to have a delegate object, which in turn will handle data events.
Could someone please clarify the task with a practical example?
I should contact an https endpoint sending authentication data (username and password) and getting back a plain text response.
Xcode 8 and Swift 3.0
Using URLSession:
URLSession Delegate call:
Using Block GET/POST/PUT/DELETE:
Working fine for me.. try it 100% result guarantee