first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:45:19 +03:00
commit 60db80892b
101 changed files with 16757 additions and 0 deletions

53
rest.client Normal file
View File

@@ -0,0 +1,53 @@
### Get all heroes (no auth)
GET http://localhost:8080/api/v1/heroes
Accept: application/json
### Get active heroes (no auth)
GET http://localhost:8080/api/v1/hero
Accept: application/json
### Update hero (JSON) — requires admin token
PUT http://localhost:8080/api/v1/hero/1
Content-Type: application/json
Authorization: Bearer {{ADMIN_TOKEN}}
{
"title": "updated-via-rest",
"is_active": false
}
### Update hero (multipart/form-data) — send file + is_active=false
PUT http://localhost:8080/api/v1/hero/1
Authorization: Bearer {{ADMIN_TOKEN}}
Content-Type: multipart/form-data; boundary=---011000010111000001101001
-----011000010111000001101001
Content-Disposition: form-data; name="title"
multipart-update
-----011000010111000001101001
Content-Disposition: form-data; name="is_active"
false
-----011000010111000001101001
Content-Disposition: form-data; name="image"; filename="test.jpg"
Content-Type: image/jpeg
< ./path/to/test.jpg
-----011000010111000001101001--
### Delete hero (admin)
DELETE http://localhost:8080/api/v1/hero/1
Authorization: Bearer {{ADMIN_TOKEN}}
---
# Equivalent curl examples:
#
# curl GET all heroes
# curl -sS http://localhost:8080/api/v1/heroes | jq '.'
#
# curl update JSON
# curl -X PUT "http://localhost:8080/api/v1/hero/1" -H "Authorization: Bearer <ADMIN_TOKEN>" -H "Content-Type: application/json" -d '{"title":"test","is_active":false}'
#
# curl multipart (with image)
# curl -X PUT "http://localhost:8080/api/v1/hero/1" -H "Authorization: Bearer <ADMIN_TOKEN>" -F "title=multipart-test" -F "is_active=false" -F "image=@/absolute/path/to/image.jpg"