I am currently developing my own project where I want to use an API to connect to the database on a web server.
I understand that when requesting data, you should use GET
and when you want to upload data, you should use POST
/ PUT
. The problem occurs when you want to log a user in. You are requesting data, meaning it should be a GET
request, however, you do not want the user credentials in the URL since that would be stored on the users history and other networking tools may be able to pick it up since it would not be secured with https.
What would be the best way of requesting user data through an API? I am making the API with the Slim Framework and am requesting the data via an iOS application I am developing in swift. Apart from using the GET
method, my API uses JSON to transmit the data.
The credentials I am talking about are to log the user into their account and not API credentials.