New to RESTful services but read a lot on the subject. Implementing in VS2010 C#
Similar (nearly identical) questions have been asked and answered here on stackoverflow, but honestly I learned nothing from the responses.
I want to implement an AuthenticatUser call where a username and password is sent and an authentication key is returned.
Given that this needs to be done with a GET, POST, PUT, OR DELETE, it seems the GET would be most appropriate.
So perhaps GET mydomain/myservice/authenticate/{username}/{password}
I don’t like this because the username and password is passed in the URI, but as I understand it is not a good idea to send a body in a GET. So a POST or PUT would work, but that seems to diverge from the RESTFul philosophy.
Question 1: Is it OK to send sensitive data like password in the URL? The site will use SSL.
Question 2: In GETs when there are multiple parameters being passed, it seems like the URI concept would get a bit crazy, how are complex queries supposed to be handled RESTfully?
Question 3: What is the preferred (normal, most common) method of authentication in a RESTful API?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…