-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhttp.yml
More file actions
57 lines (56 loc) · 1.09 KB
/
http.yml
File metadata and controls
57 lines (56 loc) · 1.09 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
name: REST API Example
vars:
token: "{{TOKEN ?? 'secret'}}"
url: "{{URL ?? 'http://localhost:8080'}}"
jobs:
- name: "Request to {{vars.url}}"
defaults:
http:
url: "{{vars.url}}"
headers:
authorization: "Bearer {{vars.token}}"
content-type: application/json
accept: application/json
steps:
- name: Post
id: hello
uses: http
with:
post: /post
body:
message: hello
test: |
res.code == 200 &&
res.body.json.message == "hello"
echo: |
IP: {{res.body.origin}}
outputs:
ip: res.body.origin
- name: Get
uses: http
with:
get: /get
test: |
res.code == 200 &&
res.body.url == "http://localhost:8080/get"
- name: Update
uses: http
with:
put: /put
body:
ip: "{{outputs.hello.ip}}"
test: |
res.code == 200 &&
res.body.json.ip == outputs.hello.ip
- name: Patch
uses: http
with:
patch: /patch
body:
message: yo
- name: Delete
uses: http
with:
delete: /delete
test: |
res.code == 200