What's the REST way to verify an email?

后端 未结 3 1863
情书的邮戳
情书的邮戳 2021-02-18 19:53

When a user register to my web application I send an email to verify his inbox. In the email there are a link to a resource like this:

GET /verify/{token}
         


        
3条回答
  •  既然无缘
    2021-02-18 20:50

    It depends on what are you trying to do.

    Does it fire an email after validating the user for example? If so, it is not an idempotent method and you should use POST.

    Example:

    POST /users/{id}/verify/{token}
    

    If the method doesn't have any consequence besides the update, I think you should use PUT.

提交回复
热议问题