-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathnon-draft-request.http
More file actions
67 lines (51 loc) · 2.24 KB
/
non-draft-request.http
File metadata and controls
67 lines (51 loc) · 2.24 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
64
65
66
67
@host = http://localhost:4004
@auth = Basic YWxpY2U6d29uZGVybGFuZA==
// Send the requests sequentially to avoid any conflicts
### Get list of all incidents
# @name incidents
GET {{host}}/odata/v4/admin/Incidents
Authorization: {{auth}}
### Creating attachment (metadata request)
@incidentsID = {{incidents.response.body.value[2].ID}}
# @name createAttachment
POST {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments
Authorization: {{auth}}
Content-Type: application/json
{
"filename": "sample-1.jpg"
}
### Put attachment content (content request)
@attachmentsID = {{createAttachment.response.body.ID}}
PUT {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(ID={{attachmentsID}})/content
Authorization: {{auth}}
Content-Type: image/jpeg
< ./integration/content/sample-1.jpg
### Test if we can overwrite attachment content
PUT {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(ID={{attachmentsID}})/content
Authorization: {{auth}}
Content-Type: application/pdf
< ./integration/content/sample.pdf
### Get newly created attachment metadata
GET {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(ID={{attachmentsID}})
Authorization: {{auth}}
### Fetching newly created attachment content
GET {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(ID={{attachmentsID}})/content
Authorization: {{auth}}
### Get list of attachments for a particular incident
# @name attachments
GET {{host}}/odata/v4/admin/Incidents(ID={{incidentsID}})/attachments
Authorization: {{auth}}
### Get attachments content
GET {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(ID={{attachmentsID}})/content
Authorization: {{auth}}
### Get attachments content with up__ID included
GET {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(up__ID={{incidentsID}},ID={{attachmentsID}})/content
Authorization: {{auth}}
### Put attachment content (content request) with up__ID included
PUT {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(up__ID={{incidentsID}},ID={{attachmentsID}})/content
Authorization: {{auth}}
Content-Type: image/jpeg
< ./integration/content/sample-1.jpg
### Delete attachment
DELETE {{host}}/odata/v4/admin/Incidents({{incidentsID}})/attachments(ID={{attachmentsID}})
Authorization: {{auth}}