All responses will have the form
{
"data": {
"name": "name of the user",
"age": "age of the user",
"occupation": "occupation of the user"
},
"message": "Description of what happened"
}
Subsequent response definitions will only detail the expected value of the 'data field'
Definition
'GET /users'
Response
- '200 OK' on success
[
{
"name": "Arman",
"age": 20,
"occupation": "Student"
},
{
"name": "Matt",
"age": 30,
"occupation": "Teacher"
}
]
Definition
'POST /user/name'
ARGUMENTS
"name":string
a globally unique identifier for the user's name"age":int
the user's age"occupation":string
the user's current occupation
RESPONSE
201 Created
on success
{
"name": "Arman",
"age": 20,
"occupation": "Student"
}
'GET /user/name'
Response
- '404 Not Found' if the user does not exist
- '200 OK' on success
{
"name": "Arman",
"age": 20,
"occupation": "Student"
}
- Navigate to the directory where data.py is located
- run "python app.py" in the terminal
- Open Postman application
- Enter the http provided in the terminal when you ran the file