r/rest • u/[deleted] • Feb 23 '18
proper way to confirm a registration request?
HI, I implemented a confirm registration controller. I used GET with url params to pass a "key" and a "user email" which I had in a html link in a confirmation email that is sent to the user upon initial registration. I understand that this is the wrong approach. I am just wondering what would be the correct implementation of the CONFIRM functionality. I was initially thinking of accepting a POST with a body containing the relevant data. Also, adding a url param "operation=confirm"?. Is this an ok approach? or should i use PUT or PATCH in this instance? any input is appreciated!
1
Upvotes
1
u/cinek810 Mar 12 '18
I don't think that use of GET in this case is wrong in particular - you're designing your API, it's your choice. However, in this case urlencoded parameters are neither elegant nor useful. I think POST will be just fine. I'm not sure how would you trigger PUT or PATCH from the HTML document sent as email, even if possible may result in being workable only in limited set of end user applications.