-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.http
72 lines (45 loc) · 2.52 KB
/
.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
POST http://localhost:8001/api/v1/register/
Content-Type: application/json'
{
"username": "saeed",
"email": "[email protected]",
"password": "saeed"
}
##### @name login
curl -X POST http://127.0.0.1:8001/api/v1/token/ -H "Content-Type: application/json" -d '{"username": "saeed", "password": "saeed"}'
######
@authToken = {{login.response.body.access}}
##### GET ALL PRODUCTS ######
curl -X GET http://127.0.0.1:8001/api/v1/products/
######### Add product
POST http://127.0.0.1:8001/api/v1/products
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIwNDQwMTI4LCJqdGkiOiJkOWNiMjJlY2M4MGI0OGUwODNjOGExYzNkMzg3MGM3ZSIsInVzZXJfaWQiOjN9.8LHx-hxmsVOVajBog8eUdwaVa-8VHrwiywhtK3kcQjg
Content-Type: application/json
{
"name": "Mercedes",
"price": 5000
}
#### Edit Product Price
PATCH http://127.0.0.1:8001/api/v1/products/1/
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIwMjczNjE3LCJqdGkiOiJjMTNhMWZiY2JhNDA0ZGMzOWQ4MjRiMWM1MmE2OWZkMyIsInVzZXJfaWQiOjN9.ACw-43JLK0f9ViO3mFaLbKB7ZR749ozJGeFczzHmF5k
Content-Type: application/json"
{
"price": 4000
}
##### Get Cart details
GET http://127.0.0.1:8001/api/v1/cart
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIwNDQwMTI4LCJqdGkiOiJkOWNiMjJlY2M4MGI0OGUwODNjOGExYzNkMzg3MGM3ZSIsInVzZXJfaWQiOjN9.8LHx-hxmsVOVajBog8eUdwaVa-8VHrwiywhtK3kcQjg
##### Add Cart Item
POST http://127.0.0.1:8001/api/v1/cart/
Content-Type: application/json"
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIwNDMyNDM1LCJpYXQiOjE3MjA0MzIxMzUsImp0aSI6IjA2Mzg2ZjQ0MGI3NjQxMjE5ZjU2NWExMjM0N2NkNmE3IiwidXNlcl9pZCI6Mn0.rPBVd0_ZqY6xox31QKZYrkgxH6p-tb8qQ4vuFvxL1AY
{ "product": 1, "quantity": 2}
##### Delete cart Item
DELETE http://127.0.0.1:8001/api/v1/cart/1/
Content-Type: application/json"
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIwNDMyNDM1LCJpYXQiOjE3MjA0MzIxMzUsImp0aSI6IjA2Mzg2ZjQ0MGI3NjQxMjE5ZjU2NWExMjM0N2NkNmE3IiwidXNlcl9pZCI6Mn0.rPBVd0_ZqY6xox31QKZYrkgxH6p-tb8qQ4vuFvxL1AY
##### Checkout
POST http://127.0.0.1:8001/api/v1/checkout/
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzIwNDMyNDM1LCJpYXQiOjE3MjA0MzIxMzUsImp0aSI6IjA2Mzg2ZjQ0MGI3NjQxMjE5ZjU2NWExMjM0N2NkNmE3IiwidXNlcl9pZCI6Mn0.rPBVd0_ZqY6xox31QKZYrkgxH6p-tb8qQ4vuFvxL1AY