Hacker News new | past | comments | ask | show | jobs | submit login

In a RESTful API that I'm currently working on I did wonder about how best to create URIs for resources that you want to create via a PUT. To try to stick to the rule that "Servers must have the freedom to control their own namespace" (which is sensible if you are going to have multiple difference server implementations with different technology stacks) I chose to return a template URI for the container resource and then allow the client to use this template to create URIs. Along the lines of:

http://foo/bar/{name}

or

http://foo/floop.ashx?path=/bar/{name}

The client replacing {name} with the actual intended resource name.

Not sure if this is a good idea or not - but it seems to work!




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: