To API jest fikcyjne (mock). Nie zapisuje danych – odpowiedzi służą wyłącznie do ćwiczeń.
Bazowy URL: https://mad-qa.pl
Opis: Lista wszystkich produktów.
Expected:
status: 200
body:
{
"items": [
{ "id": 1, "name": "Miecz Runiczny", "price": 199.99, "currency": "PLN" },
...
],
"count": 8
}
curl -k -L "https://mad-qa.pl/api/index.php?endpoint=products"
Opis: Pojedynczy produkt po ID.
Expected:
status: 200
body:
{
"id": 3,
"name": "Peleryna Maskująca",
"price": 349.00,
"currency": "PLN"
}
curl -k -L "https://mad-qa.pl/api/index.php?endpoint=products&id=3"
Opis: Mock tworzenia produktu. Zwraca 201 Created i losowe id. Bez zapisu.
Request body:
{
"name": "Testowy produkt",
"price": 123.45,
"currency": "PLN"
}
Expected:
status: 201
body:
{
"message": "created (mock)",
"product": {
"name": "Testowy produkt",
"price": 123.45,
"currency": "PLN",
"id": 8452
}
}
curl -k -L -X POST "https://mad-qa.pl/api/index.php?endpoint=products" -H "Content-Type: application/json" -d "{"name":"Testowy produkt","price":123.45,"currency":"PLN"}"
Opis: Mock całkowitej podmiany zasobu. Zwrot 200 OK. Bez zapisu.
Request body:
{ "name": "Zmieniony", "price": 111.11 }
Expected:
status: 200
body:
{
"message": "replaced (mock)",
"product": { "id": 3, "name": "Zmieniony", "price": 111.11 },
"note": "No persistence. This is a mock response."
}
curl -k -L -X PUT "https://mad-qa.pl/api/index.php?endpoint=products&id=3" -H "Content-Type: application/json" -d "{"name":"Zmieniony","price":111.11}"
Opis: Mock częściowej aktualizacji. Zwrot 200 OK. Bez zapisu.
Request body:
{ "price": 222.22 }
Expected:
status: 200
body:
{
"message": "updated (mock)",
"changes": { "price": 222.22 },
"product": { "id": 3, "price": 222.22 },
"note": "No persistence. This is a mock response."
}
curl -k -L -X PATCH "https://mad-qa.pl/api/index.php?endpoint=products&id=3" -H "Content-Type: application/json" -d "{"price":222.22}"
Opis: Mock usunięcia zasobu. Zwraca 204 No Content. Bez zapisu.
Expected: status: 204 body: (empty)
curl -k -L -X DELETE "https://mad-qa.pl/api/index.php?endpoint=products&id=3"