Skip to content

Commit 675e654

Browse files
committed
Add return documentation and sample
1 parent c73e8c3 commit 675e654

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/04-Examples/041-http-examples.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ request:
4747
url_params:
4848
foo: bar
4949
two: 2
50+
51+
# get only response code
52+
return: .code
5053
```
5154
5255
### Request with query string and header
@@ -123,8 +126,6 @@ request:
123126
124127
auth[bearer]:
125128
token: eyJhbGciOiJIU...4fwpMeJf36POk6yJV_adQssw5c
126-
127-
body[none]: ~
128129
```
129130

130131
### Request with JSON body
@@ -145,6 +146,9 @@ request:
145146
token: eyJhbGciOiJIU...4fwpMeJf36POk6yJV_adQssw5c
146147
147148
body[json]: { user_id: 32, roll_no: 1, class: 2, name: 'Student name' }
149+
150+
# get every thing out of response received
151+
return: ~
148152
```
149153

150154
### Request with form
@@ -178,6 +182,9 @@ request:
178182
# note: this will just set photo with file path as string,
179183
# but will not upload the actual file
180184
photo: file:///home/username/student-photo-01.png
185+
186+
# get only response body; response headers, code, etc will be dropped
187+
return: .body
181188
```
182189

183190
### Request with file upload

docs/05-References/051-http-reference.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,11 @@ request:
9797
of the world.</description>
9898
</book>
9999
</catalog>
100+
101+
# returns given part of the response after
102+
# the request have been executed and got response
103+
#
104+
# supported values: 'version', 'code', 'reason', 'headers', 'body'
105+
# if not available, or set as null, returns all parts of response
106+
return: ~
100107
```

0 commit comments

Comments
 (0)