Skip to content

RESTful API A3

annypanny edited this page Nov 29, 2016 · 8 revisions

/author/create

  • It used to create a new author (author sign up) on the server.
  • It returned a JSON.
  • JSON file contains:
    • "id"
    • "displayName"
    • "username"
    • "password"
    • "email"
    • "first_name"
    • "last_name"
    • "avatar"
    • "host"
    • "github"
    • "date_created"

Method:

POST

Example:

GET /authors/create/

HTTP 405 Method Not Allowed
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept

{
	"detail": "Method \"GET\" not allowed."
}

after author fill out the sign up information on the html, it would return:

POST /author/create


HTTP 201 Created
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept

{
	"id": "0abf9564-7f6f-480e-9da2-89a365ee6b29",
	"displayName": "Anny",
	"username": "XInyi",
	"password": "pbkdf2_sha256$30000$59ess4NwHYVD$50V3Lnb+/3pqzCyawwhmFrRTyMznIwN+teSnK+srA2A=",
	"email": "anny@hotmail.com",
	"first_name": "Xinyi",
	"last_name": "P",
	"github": "anny",
	"avatar": "",
	"date_created": "2016-11-29T10:46:16.423696Z",
	"host": "http://socialnets404.herokuapp.com/"
}
Clone this wiki locally