This API was developed to solve a coding challenge suggested by CodeLeap.
python3 -m venv env
source env/bin/activate
pip install djangorestframework
cd api
python .\manage.py runserver
GET http://localhost:8000/careers/
[
{
"id": 1,
"username": "GabrielSpacki",
"created_datetime": "2024-02-29T05:14:38.528455Z",
"title": "My First Post",
"content": "Hello, World!"
},
{
"id": 2,
"username": "LauraSilvestrin",
"created_datetime": "2024-02-29T05:15:03.986621Z",
"title": "Hey!!",
"content": "Hello, Everyone!"
},
{
"id": 3,
"username": "LauraSilvestrin",
"created_datetime": "2024-02-29T05:15:59.723869Z",
"title": "Hey!!",
"content": "fixed!"
},
]
POST http://localhost:8000/careers/
Input
{
"username": "GabrielSpacki",
"title": "Example of a new post!",
"content": "Type something nice here :)"
},
Output
{
"id": 1,
"username": "GabrielSpacki",
"created_datetime": "2024-02-29T05:14:38.528455Z",
"title": "Example of a new post!",
"content": "Type something nice here :)"
},
PATCH http://localhost:8000/careers/${id}/
Parameter | Type | Description |
---|---|---|
id |
integer |
Mandatory. The ID of the post that you're updating |
Input
{
"title": "Example of a new post! (Updated)",
"content": "Type something great here :)"
},
Output
{
"id": 1,
"username": "GabrielSpacki",
"created_datetime": "2024-02-29T05:14:38.528455Z",
"title": "Example of a new post! (Updated)",
"content": "Type something great here :)"
},
DELETE http://localhost:8000/careers/${id}/
Parameter | Type | Description |
---|---|---|
id |
integer |
Mandatory. The ID of the post that you're updating |
Output
{}