-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.http
82 lines (60 loc) · 1.85 KB
/
test.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
72
73
74
75
76
77
78
79
80
81
82
### Health
GET {{base_url}}/actuator/health
### Accepted mime types
GET {{base_url}}/api/images/accepted-mime-types
### Image Operations
GET {{base_url}}/api/images/operations
### Register
POST {{base_url}}/register
Content-Type: application/json
{
"username": "shane",
"password": "shane",
"email": "[email protected]"
}
### Login
POST {{base_url}}/login
Content-Type: application/json
{
"username": "shane",
"password": "shane"
}
> {% client.global.set("auth_token", response.body.token); %}
### Who am I?
GET {{base_url}}/whoami
Authorization: Bearer {{auth_token}}
### Upload valid image
POST {{base_url}}/api/images/upload
Authorization: Bearer {{auth_token}}
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="file"; filename="test1-2016x1512-360k.jpg"
< ./etc/test-images/test1-2016x1512-360k.jpg
--WebAppBoundary--
> {% client.global.set("image_id", response.body.id); %}
### Image by id
GET {{base_url}}/api/images/{{image_id}}
Authorization: Bearer {{auth_token}}
### Download image
GET {{base_url}}/api/images/{{image_id}}/download
Authorization: Bearer {{auth_token}}
### Images
GET {{base_url}}/api/images
Authorization: Bearer {{auth_token}}
### Logs
GET {{base_url}}/api/logs
Authorization: Bearer {{auth_token}}
### Upload invalid image
POST {{base_url}}/api/images/upload
Authorization: Bearer {{auth_token}}
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="file"; filename="brain-1552824775.svg"
< ./etc/test-images/brain-1552824775.svg
### Upload a non-image file
POST {{base_url}}/api/images/upload
Authorization: Bearer {{auth_token}}
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="file"; filename="invalid.txt"
< ./etc/invalid-test-files/invalid.txt