Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is what I've done in APIs I designed. You end up with requests like this:

  POST /widgets
  Content-Type: application/json
  --
  {"name": "An example widget", "color": "blue"}
With the response being:

  201 CREATED
  Location: /widgets/37
  --
  (no body)


yes, I know I have read somewhere that this is "recommended" for REST apis, but I'll be damned if I can find the source.


This is the pattern that's recommended in Thomas Erl's SOA with REST book. (http://www.amazon.com/dp/0137012519)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: