Request
GET: https://localhost:5000/albums
Response
{
"data": [
{
"_id": "65348f16fea56e0d94903eab",
"artist": "John Coltrane",
"id": 1,
"price": 56.99,
"title": "Blue Train"
},
{
"_id": "65348f2efea56e0d94903ead",
"artist": "Gerry Mulligan",
"id": 2,
"price": 17.99,
"title": "Blue Train"
},
{
"_id": "65348f4cfea56e0d94903eaf",
"artist": "Sarah Vaughan",
"id": 3,
"price": 39.99,
"title": "Sarah Vaughan and Clifford Brown"
}
],
"status": 200
}
Request Body
GET: https://localhost:5000/albums/query?id=1
Response
{
"data": {
"id": 1,
"title": "Blue Train",
"artist": "John Coltrane",
"price": 56.99
},
"message": "Find album successfully",
"status": 200
}
POST: https://localhost:5000/albums/add
Request Body
{
"title": "Nơi Nào Có Tình Yêu",
"artist": "Minh Trí",
"price": 150.00
}
Response
{
"data": {
"id": 4,
"title": "Nơi Nào Có Tình Yêu",
"artist": "Minh Trí",
"price": 150
},
"message": "Insert album successfully",
"status": 200
}
DELETE: https://localhost:5000/albums/delete
Request Body
{
"id": 4
}
Response
{
"albums": 4,
"message": "Delete album successfully",
"status": 200
}
PUT: https://localhost:5000/albums/edit
Request Body
{
"id": 4,
"title": "Nơi Không Có Em 2",
"artist": "Minh Trí",
"price": 150.69
}
Response
{
"data": {
"MatchedCount": 1,
"ModifiedCount": 1,
"UpsertedCount": 0,
"UpsertedID": null
},
"message": "Edit album successfully",
"status": 200
}
GET Method
POST Method