-
Notifications
You must be signed in to change notification settings - Fork 2
RESTful API P4
annypanny edited this page Nov 29, 2016
·
10 revisions
/posts/create
- It used to create a post for the current authenticate author. Author need to fill out text in html form.
- It send these data as a JSON file to the server.
- Server returned a message.
- JSON file contains:
- "id"
- "title"
- "description"
- "content_type"
- "content"
- "Image"
- "Visibility"
Method:
POST
Example:
GET /posts/create
HTTP 405 Method Not Allowed
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept
{
"detail": "Method \"GET\" not allowed."
}
After the author made the post, it would return:
POST /posts/create
HTTP 201 Created
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept