I've implemented CRUD functionality pretty restfully in my WebAPI project. I'm now trying to implement Archiving of objects (not quite deleting) - if only there were an
ARCHIVE HTTP method.
I see two options:
isArchived as a property of every archive-able entity, which must be included in PUT and POST requests even if archiving isn't relevant to the request. Archiving an entity would be a matter of calling
PUT /api/object/id with isArchived set to true. Seems bulky on the wire but restful.
2) Have an RPC-ish url like
PUT /api/object/id/archive that doesn't require a body. Seems the most efficient but not restful.
What's everyone doing in the "archive my stuff via an api call" space?
If you always archive a particular resource and never delete it, I would repurpose DELETE to actually archive. If you really need to differentiate between delete and archive, I would either do
GET /foo/33 200 OK <foo id="33">blah</foo> POST /archive <foo id="33">blah</foo> 201 Created Location: http://example.org/archive/foo/33
POST /archive?target=http://example.org/foo/33 201 Created Location: http://example.org/archive/foo/33
- How to set custom rates, for throttling in django rest framework?
- Enable CORS for Web Api 2 and OWIN token authentication
- How to send multiple files in postman ReSTful web service?
- keyCode values for numeric keypad?
- Django validate DateTime
- WooCommerce API - Update Order Meta Fields
- How to get current logged in username from Active Directory?
- VSTS Powershell Secret Variable
- Pass parameters to web api controller with jQuery data attribute
- Make local web api call from local web forms app
- e physical and technical restrictions. Web accessibility is
- ences across application restarts. 59 | simple-storage | A
- t, Rest parameters The rest parameter syntax allows us to
- ['class' => 'yii\rest\UrlRule', 'controller' => 'use
- pose * CairoContext::restore \- The restore purpose
- s content or UI from the rest of the web application or page
- these compromises to be restricted only to devices that nee