UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Post 200 with username & Password login

Forums > SwiftUI

I am having a very hard time in finding any informaiton on how I can do a Post by logging into the server with these parameters

let parameters: Parameters = ["username": username, "password": password]

and my return from the server would be

if let userID = jsonResponse["user_id"] as? String, let customerID = jsonResponse["customer_id"] as? String

Can someone please help me on where I can this information.

3      

Hello, without 3rd party libraries you can use URLSession. For example like in this gist - https://gist.github.com/dmathewwws/63064a4114fba3769448602208f66c0d#file-urlsession-post-swift-L26-L27

You can get an app like Postman, Paw and similar to test sending POST requests before implementing them to validate that server responds correctly.

3      

AFTER viewing this video I was able to understand how it works. Here is the video for anyone who wants to understand Post 200 https://www.youtube.com/watch?v=hDlPaOQOlHs&t=232s

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.