خرید بک لینک

Vote count: 0

Imagine a simple REST API that allows to create a user account, by sending a JSON resource to POST /users as in the following. By default it sends out a confirmation email to the user.

{
   "useame": "john@appleseed.com",
   "password": "secret"
}

However sometimes there are good reasons for not sending out a confirmation based on the use case, e.g. another API client, or admins signing up users on their behalf.

Since it doesn't have any implications on the created resource but is more of an instruction how to create the user, should it be separate from the request body? What's the best way to do this?

  1. Specify a custom header Confirmation: no-confirmation
  2. Add a query param ?confirmation=false
  3. Add a send_confirmation field to the request body
asked 38 secs ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: شنبه 1 اسفند 1394 ساعت: 16:27

صفحه بندی