-
Notifications
You must be signed in to change notification settings - Fork 0
/
product-api-request.http
75 lines (52 loc) · 2.01 KB
/
product-api-request.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
// ------ Product api ------
### Get product
GET http://localhost:8081/api/v2/product HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjE5MjE0NjcsImlkIjoxLCJsZXZlbCI6Im5vcm1hbCIsInVzZXJuYW1lIjoia2Fyb29uIn0.pppz_2K-_ZLCpfPRrmRxRSlCddj7PlSY8ly_xTG_w_g
### Get product by id
GET http://localhost:8081/api/v2/product/3 HTTP/1.1
Content-Type: application/json
### Create product
POST http://localhost:8081/api/v2/product HTTP/1.1
Content-Type: application/json
{
"product":"test"
}
### Create product
POST http://localhost:8081/api/v2/product HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="name";
Angular 2
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="stock";
300
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="price";
180
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="go.png"
Content-Type: image/png
< ./go.png
------WebKitFormBoundary7MA4YWxkTrZu0gW--
### Edit
PUT http://localhost:8081/api/v2/product HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTk4OTg1OTQsImlkIjoxLCJsZXZlbCI6Im5vcm1hbCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.e8ZcnQFnye_DldUnzyqfth37SVB0hp8ZEjvRCy7th4s
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="id";
2
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="name";
Arduino board (Edit)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="stock";
101
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="price";
200
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="go.png"
Content-Type: image/png
< ./go.png
------WebKitFormBoundary7MA4YWxkTrZu0gW--