1
+ # Fetch all products from the API
1
2
GET https://bazzar-39eb.onrender.com/api/products
2
3
3
4
###
5
+
6
+ # Register a new user
7
+ # Replace YOUR_USERNAME, YOUR_EMAIL, and YOUR_PASSWORD with the user's details
4
8
curl -X POST https://bazzar-39eb.onrender.com/api/register \
5
9
-H "Content-Type: application/json" \
6
10
-d '{
7
- "username" : " alex " ,
8
-
9
- "password" : " senha123 "
11
+ "username" : " YOUR_USERNAME " ,
12
+ "email" : " YOUR_EMAIL " ,
13
+ "password" : " YOUR_PASSWORD "
10
14
}'
11
15
12
16
###
17
+
18
+ # Login with an existing user
19
+ # Replace YOUR_EMAIL and YOUR_PASSWORD with the user's credentials
13
20
curl -X POST https://bazzar-39eb.onrender.com/api/login \
14
21
-H "Content-Type: application/json" \
15
22
-d '{
16
-
17
- "password" : " senha123 "
23
+ "email" : " YOUR_EMAIL " ,
24
+ "password" : " YOUR_PASSWORD "
18
25
}'
19
26
20
27
###
28
+
29
+ # Add an item to the cart
30
+ # Replace YOUR_JWT_TOKEN with the JWT obtained from login
31
+ # Replace YOUR_USER_ID, YOUR_PRODUCT_ID, and YOUR_QUANTITY with the relevant details
21
32
curl -X POST https://bazzar-39eb.onrender.com/api/cart \
22
- -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhbGV4QHRlc3RlLmNvbSIsImlhdCI6MTcyNjI1MDI2NCwiZXhwIjoxNzI2MjUzODY0fQ.mjvHzrGeXoEPt8zO6U18zP1hSYiswlcUhHplv49wYbM " \
33
+ -H "Authorization: Bearer YOUR_JWT_TOKEN " \
23
34
-H "Content-Type: application/json" \
24
35
-d '{
25
- "user_id" : 1 ,
26
- "product_id" : 5 ,
27
- "quantity" : 1
36
+ "user_id" : YOUR_USER_ID ,
37
+ "product_id" : YOUR_PRODUCT_ID ,
38
+ "quantity" : YOUR_QUANTITY
28
39
}'
29
40
30
41
###
31
- curl -X GET https://bazzar-39eb.onrender.com/api/cart \
32
- -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhbGV4QHRlc3RlLmNvbSIsImlhdCI6MTcyNjI1NTM0OCwiZXhwIjoxNzI2MjU4OTQ4fQ.z2wF3ZG3qHV6nqWlPux7d9a8km5rOw6hMzYUl0KhTs4"
33
42
43
+ # Retrieve the user's cart items
44
+ # Replace YOUR_JWT_TOKEN with the JWT obtained from login
45
+ curl -X GET https://bazzar-39eb.onrender.com/api/cart \
46
+ -H "Authorization: Bearer YOUR_JWT_TOKEN"
34
47
35
48
###
36
- curl -X DELETE "https://bazzar-39eb.onrender.com/api/cart/6" \
37
- -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhbGV4QHRlc3RlLmNvbSIsImlhdCI6MTcyNjI0OTgzNCwiZXhwIjoxNzI2MjUzNDM0fQ.YH_8-lPZxkw-dge528CSzVFY_8uTrNgc_R4GkhJqRpw" \
38
- -H "Content-Type: application/json"
39
-
40
49
50
+ # Remove an item from the cart
51
+ # Replace YOUR_JWT_TOKEN with the JWT obtained from login
52
+ # Replace YOUR_CART_ITEM_ID with the ID of the item you want to remove
53
+ curl -X DELETE "https://bazzar-39eb.onrender.com/api/cart/YOUR_CART_ITEM_ID" \
54
+ -H "Authorization: Bearer YOUR_JWT_TOKEN" \
55
+ -H "Content-Type: application/json"
41
56
42
- # Outro Usuário
57
+ # Another User
43
58
44
59
###
60
+
61
+ # Register another new user
62
+ # Replace ANOTHER_USERNAME, ANOTHER_EMAIL, and ANOTHER_PASSWORD with the user's details
45
63
curl -X POST https://bazzar-39eb.onrender.com/api/register \
46
64
-H "Content-Type: application/json" \
47
65
-d '{
48
- "username" : " Alex Santos " ,
49
-
50
- "password" : " senhamuitosegura "
66
+ "username" : " ANOTHER_USERNAME " ,
67
+ "email" : " ANOTHER_EMAIL " ,
68
+ "password" : " ANOTHER_PASSWORD "
51
69
}'
52
70
53
71
###
72
+
73
+ # Login with another existing user
74
+ # Replace ANOTHER_EMAIL and ANOTHER_PASSWORD with the user's credentials
54
75
curl -X POST https://bazzar-39eb.onrender.com/api/login \
55
76
-H "Content-Type: application/json" \
56
77
-d '{
57
-
58
- "password" : " senhamuitosegura "
78
+ "email" : " ANOTHER_EMAIL " ,
79
+ "password" : " ANOTHER_PASSWORD "
59
80
}'
60
81
61
82
###
83
+
84
+ # Add an item to the cart for another user
85
+ # Replace ANOTHER_JWT_TOKEN with the JWT obtained from login
86
+ # Replace ANOTHER_USER_ID, ANOTHER_PRODUCT_ID, and ANOTHER_QUANTITY with the relevant details
62
87
curl -X POST https://bazzar-39eb.onrender.com/api/cart \
63
- -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhbGV4YW5kcmVAdGVzdGUuY29tIiwiaWF0IjoxNzI2MjQ1NzYyLCJleHAiOjE3MjYyNDkzNjJ9.gHCN9GE9CXPkwAIJuvVtBnkiU_7QTcu-rMm-oQ6lNCQ " \
88
+ -H "Authorization: Bearer ANOTHER_JWT_TOKEN " \
64
89
-H "Content-Type: application/json" \
65
90
-d '{
66
- "user_id" : 1 ,
67
- "product_id" : 3 ,
68
- "quantity" : 5
91
+ "user_id" : ANOTHER_USER_ID ,
92
+ "product_id" : ANOTHER_PRODUCT_ID ,
93
+ "quantity" : ANOTHER_QUANTITY
69
94
}'
70
95
71
96
###
97
+
98
+ # Retrieve the cart items for another user
99
+ # Replace ANOTHER_JWT_TOKEN with the JWT obtained from login
72
100
curl -X GET https://bazzar-39eb.onrender.com/api/cart \
73
- -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhbGV4YW5kcmVAdGVzdGUuY29tIiwiaWF0IjoxNzI2MjQ1NzYyLCJleHAiOjE3MjYyNDkzNjJ9.gHCN9GE9CXPkwAIJuvVtBnkiU_7QTcu-rMm-oQ6lNCQ"
101
+ -H "Authorization: Bearer ANOTHER_JWT_TOKEN"
102
+
103
+ # Note: If you are testing locally, replace the API URL with http://localhost:5000
0 commit comments