-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
63 lines (47 loc) · 1.18 KB
/
Copy pathrequests.http
File metadata and controls
63 lines (47 loc) · 1.18 KB
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
// requests.http
@baseUrl = http://localhost:8000
### 1. Test Root Endpoint (Health Check)
GET {{baseUrl}}/
### 2. Get All Users (Should be empty initially)
GET {{baseUrl}}/users
### 3. Create User 1
POST {{baseUrl}}/users
Content-Type: application/json
{
"name": "Alice Smith",
"email": "alice@example.com"
}
### 4. Create User 2
POST {{baseUrl}}/users
Content-Type: application/json
{
"name": "Bob Jones",
"email": "bob@example.com"
}
### 5. Create User 3
POST {{baseUrl}}/users
Content-Type: application/json
{
"name": "Charlie Day",
"email": "charlie@example.com"
}
### 6. Get All Users (Should see 3 users now)
GET {{baseUrl}}/users
### 7. Get Single User (Assuming ID 1 exists)
GET {{baseUrl}}/users/1
### 8. Get User that does not exist (Test 404)
GET {{baseUrl}}/users/9999
### 9. Update User 2
# Note: Ensure your backend handles PUT or PATCH for updates
PUT {{baseUrl}}/users/2
Content-Type: application/json
{
"name": "Bob James",
"email": "bobjames@example.com"
}
### 10. Get All Users (Verify Update)
GET {{baseUrl}}/users
### 11. Delete User 2
DELETE {{baseUrl}}/users/3
### 12. Get All Users (Final check - Bob should be gone)
GET {{baseUrl}}/users