-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.http
64 lines (52 loc) · 1.15 KB
/
example.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
---
host: <%= Deno.env.get('HOST') || 'https://faker.deno.dev' %>
explanation: If the first block does not have a request its metadata will be use globally for all requests.
---
###
---
needs: loginTest
id: depends on login
---
POST https://example.com/onlyAdmin
Authorization: Bearer <%= loginTest.body.jwt %>
Content-Type: application/json
{"name": "Garn"}
# write the expected response to validate the actual response
HTTP/1.1 403 Forbidden
### requests separator
---
id: optional name
timeout: 500 # must respond in less than 500ms
---
GET /?body=hola&status=400
host: https://faker.deno.dev
quiet: true
###
---
id: name
---
GET https://example.com
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
###
---
redirect: follow
description: |
you can pass the requestInit has metadata: fetch api doc: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters
---
GET /image/avatar
quiet: true
HTTP/1.1 400 Bad Request
###
---
id: assert json body
---
GET https://httpbin.org/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"slideshow": {
"title": "Sample Slide Show"
},
"unexpected": "this should not be here"
}