Django project to model "box" resource.
Method: POST
URL: http://localhost:8000/login/
Form-Data:
{
"username": "your_username",
"password": "your_password"
}
Response:
Cookies are set to form the session.
csrftoken
sessionid
headers = {
"sessionid": "your_session_id",
"X-CSRFToken": "your_csrf_token",
"Content-Type": "application/json"
}
Method: POST
URL: http://localhost:8000/create_box/
Payload:
{
"breadth": 1,
"height": 2,
"length": 333
}
Method: PUT
URL: http://localhost:8000/update_box/
Payload:
{
"breadth": 1,
"height": 2,
"length": 333
}
Method: GET
URL: http://localhost:8000/boxes/
Query Parameters:
- min_length
- max_length
- min_breadth
- max_breadth
- min_height
- max_height
- min_area
- max_area
- min_volume
- max_volume
- created_by
- min_created_at
- max_created_at
Payload:
[
{
"length": 333,
"breadth": 1,
"height": 2,
"id": 1,
"created_by_id": 1,
"updated_at": "2019-04-11T07:43:04.141468+00:00"
},
{
"length": 333,
"breadth": 1,
"height": 2,
"id": 2,
"created_by_id": 2,
"updated_at": "2019-04-11T07:44:46.841679+00:00"
}
]