-
Notifications
You must be signed in to change notification settings - Fork 2
RESTful API P6
annypanny edited this page Nov 29, 2016
·
7 revisions
/posts/[post_id]/destroy
- It used to let the authenticate author delete their own post.
- It send a DELETE request to the server.
Method:
DELETE
Example:
GET /posts/95875f36-9dc0-4672-b733-6c9bf84c2eba/destroy
HTTP 405 Method Not Allowed
Allow: DELETE, OPTIONS
Content-Type: application/json
Vary: Accept
{
"detail": "Method \"GET\" not allowed."
}
After the author delete the post, it would show:
DELETE /posts/95875f36-9dc0-4672-b733-6c9bf84c2eba/destroy
HTTP 204 No Content
Allow: DELETE, OPTIONS
Content-Type: application/json
Vary: Accept