-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.http
72 lines (50 loc) · 2.25 KB
/
client.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
### Register a new user
POST http://localhost:3333/register
Content-Type: application/json
{
"name": "Test User",
"email": "test@example.com",
"password": "Test@123!"
}
### Login
POST http://localhost:3333/login
Content-Type: application/json
{
"email": "test@example.com",
"password": "Test@123!"
}
### Save the accessToken and refreshToken from the response
### Create News (Protected Route)
POST http://localhost:3333/news
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIwMmQzZjZiMS0yMTliLTQzN2YtOTM4My0yNDRiZTA2MTZjODEiLCJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJpYXQiOjE3MzA0MDA0NTksImV4cCI6MTczMDQwMTM1OX0.G-pBq2Fy2nPRHFfyPEw_wanUT6QeCGhW2Ck7ayisyR4
{
"title": "Test News 3",
"body": "This is a test news article",
"author": "Test Author",
"imageUrl": "https://example.com/image.jpg"
}
### List All News (Public Route)
GET http://localhost:3333/news
### Get Single News (Public Route)
GET http://localhost:3333/news/3c310120-f74f-4b78-b84b-9670745db3f6
### Update News (Protected Route)
PUT http://localhost:3333/news/3c310120-f74f-4b78-b84b-9670745db3f6
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIwMmQzZjZiMS0yMTliLTQzN2YtOTM4My0yNDRiZTA2MTZjODEiLCJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJpYXQiOjE3MzA0MDA0NTksImV4cCI6MTczMDQwMTM1OX0.G-pBq2Fy2nPRHFfyPEw_wanUT6QeCGhW2Ck7ayisyR4
{
"title": "Updated Title",
"body": "Updated content"
}
### Delete News (Protected Route)
DELETE http://localhost:3333/news/3c310120-f74f-4b78-b84b-9670745db3f6
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIwMmQzZjZiMS0yMTliLTQzN2YtOTM4My0yNDRiZTA2MTZjODEiLCJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJpYXQiOjE3MzA0MDA0NTksImV4cCI6MTczMDQwMTM1OX0.G-pBq2Fy2nPRHFfyPEw_wanUT6QeCGhW2Ck7ayisyR4
### Generate Presigned URL (Protected Route)
POST http://localhost:3333/presigned-url
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIwMmQzZjZiMS0yMTliLTQzN2YtOTM4My0yNDRiZTA2MTZjODEiLCJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJpYXQiOjE3MzA2NDgyNTMsImV4cCI6MTczMDY0OTE1M30.g-BBdcF1ly2Bna1b8_OXnMaqoyNvxGDXXXSHRqRhxZo
{
"fileName": "test-image.jpg",
"fileSize": 1048576,
"contentType": "image/jpeg"
}