forked from skypro-backend/example-for-graduate-work
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrequests-ads.http
46 lines (37 loc) · 1.04 KB
/
requests-ads.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
### Create advert
POST http://localhost:8080/ads
Content-Type: multipart/form-data; boundary=WebAppBoundary
Authorization: Basic user@gmail.com password
--WebAppBoundary
Content-Disposition: form-data; name="properties"
Content-Type: application/json
{
"title": "title",
"description": "descr",
"price": 11
}
--WebAppBoundary
Content-Disposition: form-data; name="image"; filename="image.jpeg"
Content-Type: image/jpeg
![](../../../../../../Users/Edinichkin/Desktop/Java/image.jpg)
--WebAppBoundary
### Delete advert
DELETE http://localhost:8080/ads/1
Authorization: Basic user@gmail.com password
### Update advert
PATCH http://localhost:8080/ads/1
Content-Type: application/json
Authorization: Basic user@gmail.com password
{
"title": "title",
"description": "description",
"price": 111
}
### Find all adverts
GET http://localhost:8080/ads
### Find advert by Id
GET http://localhost:8080/ads/1
Authorization: Basic user@gmail.com password
### Find adverts for user
GET http://localhost:8080/ads/me
Authorization: Basic user@gmail.com password