make compose
curl -X GET http://localhost:8080/api/products \
-H "Accept: application/json"curl -X POST http://localhost:8080/api/products \
-H "Content-Type: application/json" \
-d '{
"name": "Laptop Test",
"price": 1500.0
}'💡 Catatan: Simpan
iddari respons JSON hasil POST ini — akan digunakan di langkah berikutnya.
Ganti {id} dengan ID sebenarnya dari hasil POST di atas.
curl -X GET http://localhost:8080/api/products/{id} \
-H "Accept: application/json"Contoh:
curl -X GET http://localhost:8080/api/products/6913f52e6b7648a3c246b953 \
-H "Accept: application/json"curl -X GET http://localhost:8080/api/products \
-H "Accept: application/json"Ganti {id} dengan ID yang sama seperti di atas.
curl -X DELETE http://localhost:8080/api/products/{id} \
-H "Accept: application/json"Contoh:
curl -X DELETE http://localhost:8080/api/products/6913f52e6b7648a3c246b953 \
-H "Accept: application/json"curl -X GET http://localhost:8080/api/products \
-H "Accept: application/json"