RESTful reset password and confirm email

前端 未结 7 1975
故里飘歌
故里飘歌 2021-02-08 08:36

im thinking what is the best RESTful way how confirm email and request reseting password. Im only aiming to find correct URI...

confirm email

PUT /users/{u

7条回答
  •  一生所求
    2021-02-08 09:06

    Here is a RESTful way.

    Request

    PUT /{userid}/email HTTP/1.1
    Content-Type: text/json+confirmation-code
    
    {"activateCode": "23sfgsg3twt3rgsdhgs"}
    

    Response

    HTTP/1.1 200 OK
    Content-Type: text/json+email-status
    {"email": "my-email@address.com", "active": "true"}
    

    No verbs in the URI needed :)

提交回复
热议问题