Closed 5at closed 13 years ago
DELETE /user/1.json
? doesn't make sense to me at least.
HTTP allows for content to come back from a DELETE request. Could be useful for returning a status URL for delete's that are queued or take a long time. I can see how format would be useful to be able to specify this
yeah you can, just seems odd to me i guess, doesn't look right. you should use Accept: application/json for that really
i see your point and agree, it doesnt look right. Resource id "1.json" == Resource id "1" ?!?!?!
But by not constraining it in code you allow for both options to be available to the developer and then leave it to the developer to decide whether they use the format string or as use the Accept header.
yeah totally, nothing wrong with the option. cant remember if i even have Accept support in this module yet, was working the api up to a higher level but i've been to busy
How much support do you see is needed? IMHO There is already enough support in express: 1 - By reading the header 'Accept' and 2 - By using res.send or res.render to reply in the appropriate format.
Anymore than that might be complicating this framework, but that depends on what you have in mind.
I'd like them to route to the individual callbacks just like we do now in express-resource for the format
Is there a reason why format specifier (e.g. '.json') cannot or should not be used on create, update and/or destroy requests?
Reason I ask is that I am using the format specifier to cater to various and varied "RESTful" implementations and interpretations. i.e. support various Grids and the likes...
I have changed the line (around line number 111 of index.js):
to:
Initial tests show nothing has broken, and I do have a 'load' function to make sure id is extracted properly.
**Edit: Added Destroy (delete).