Skip to content

Commit 2bca687

Browse files
committed
docs: add example to top nodes
1 parent 47e5d3c commit 2bca687

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/references/http-spec.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,45 @@ HTTP specification document supports `default:http:0.7.2` version.
119119

120120
This is a top-level block that defines the document version. Read details of [_version reference_](/docs/references/version) here.
121121

122+
```yml {1}
123+
version: "default:http:0.7.2"
124+
125+
request:
126+
url: https://httpbin.org/get
127+
...
128+
```
129+
122130
## `variables`
123131

124132
`variables` is a top-level block that defines local variables. These variables are not accessible outside of this file scope.
125133

134+
```yml {3-4,7}
135+
version: "default:http:0.7.2"
136+
137+
variables:
138+
Name: "Variable Value"
139+
140+
request:
141+
url: https://httpbin.org/get?query=<% Name %>
142+
...
143+
```
144+
145+
126146
Read details of [*variables*](/docs/references/variables) here.
127147

128148
## `request` (<small>*`required`*</small>)
129149

130150
`request` is a required block that defines a http request. This holds many other child nodes that constructs an http request.
131151

152+
```yml {3}
153+
version: "default:http:0.7.2"
154+
155+
request:
156+
url: https://httpbin.org/get
157+
method: OPTIONS
158+
```
159+
160+
132161
### `request.url` (<small>*`required`*</small>)
133162

134163
`request.url` is a required child node to define a valid `http://` or `https://`.

0 commit comments

Comments
 (0)