Update docs.
This commit is contained in:
parent
b7becf1faa
commit
8db29b7410
|
|
@ -708,6 +708,7 @@ screencapability: low
|
|||
HTTP 200
|
||||
[Asserts]
|
||||
jsonpath "$.validated" == true
|
||||
jsonpath "$.userInfo" isObject
|
||||
jsonpath "$.userInfo.firstName" == "Franck"
|
||||
jsonpath "$.userInfo.lastName" == "Herbert"
|
||||
jsonpath "$.hasDevice" == false
|
||||
|
|
@ -1521,12 +1522,13 @@ Environment variables can only be specified in lowercase.
|
|||
Using an environment variable to set the proxy has the same effect as using the [`-x, --proxy`](#proxy) option.
|
||||
|
||||
| Variable | Description |
|
||||
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|--------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `http_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use for HTTP.<br> |
|
||||
| `https_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use for HTTPS.<br> |
|
||||
| `all_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use if no protocol-specific proxy is set.<br> |
|
||||
| `no_proxy <comma-separated list of hosts>` | List of host names that shouldn't go through any proxy.<br> |
|
||||
| `HURL_name value` | Define variable (name/value) to be used in Hurl templates. This is similar than [`--variable`](#variable) and [`--variables-file`](#variables-file) options.<br> |
|
||||
| `HURL_VARIABLE_name value` | Define variable (name/value) to be used in Hurl templates. This is similar to [`--variable`](#variable) and [`--variables-file`](#variables-file) options.<br> |
|
||||
| `HURL_SECRET_name value` | Define secret (name/value) to be used in Hurl templates. This is similar to [`--secret`](#secret) and [`--secrets-file`](#secrets-file) options.<br> |
|
||||
| `NO_COLOR` | When set to a non-empty string, do not colorize output (see [`--no-color`](#no-color) option).<br> |
|
||||
|
||||
## Exit Codes
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ sizes.
|
|||
Predicates consist of a predicate function and a predicate value. Predicate functions are:
|
||||
|
||||
| Predicate | Description | Example |
|
||||
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
|
||||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
|
||||
| __`==`__ | Query and predicate value are equal | `jsonpath "$.book" == "Dune"` |
|
||||
| __`!=`__ | Query and predicate value are different | `jsonpath "$.color" != "red"` |
|
||||
| __`>`__ | Query number or date is greater than predicate value | `jsonpath "$.year" > 1978`<br><br>`jsonpath "$.createdAt" toDate "%+" > {{ a_date }}` |
|
||||
|
|
@ -397,15 +397,16 @@ Predicates consist of a predicate function and a predicate value. Predicate func
|
|||
| __`matches`__ | Part of the query string matches the regex pattern described by the predicate value (see [regex syntax](https://docs.rs/regex/latest/regex/#syntax)) | `jsonpath "$.release" matches "\\d{4}"`<br><br>`jsonpath "$.release" matches /\d{4}/` |
|
||||
| __`exists`__ | Query returns a value | `jsonpath "$.book" exists` |
|
||||
| __`isBoolean`__ | Query returns a boolean | `jsonpath "$.succeeded" isBoolean` |
|
||||
| __`isCollection`__ | Query returns a collection | `jsonpath "$.books" isCollection` |
|
||||
| __`isEmpty`__ | Query returns an empty collection | `jsonpath "$.movies" isEmpty` |
|
||||
| __`isEmpty`__ | Query returns an empty collection (list, object) | `jsonpath "$.movies" isEmpty` |
|
||||
| __`isFloat`__ | Query returns a float | `jsonpath "$.height" isFloat` |
|
||||
| __`isInteger`__ | Query returns an integer | `jsonpath "$.count" isInteger` |
|
||||
| __`isIsoDate`__ | Query string returns a [RFC 3339] date (`YYYY-MM-DDTHH:mm:ss.sssZ`) | `jsonpath "$.publication_date" isIsoDate` |
|
||||
| __`isNumber`__ | Query returns an integer or a float | `jsonpath "$.count" isNumber` |
|
||||
| __`isString`__ | Query returns a string | `jsonpath "$.name" isString` |
|
||||
| __`isIpv4`__ | Query returns an IPv4 address | `ip isIpv4` |
|
||||
| __`isIpv6`__ | Query returns an IPv6 address | `ip isIpv6` |
|
||||
| __`isIsoDate`__ | Query string returns a [RFC 3339] date (`YYYY-MM-DDTHH:mm:ss.sssZ`) | `jsonpath "$.publication_date" isIsoDate` |
|
||||
| __`isList`__ | Query returns a list | `jsonpath "$.books" isList` |
|
||||
| __`isNumber`__ | Query returns an integer or a float | `jsonpath "$.count" isNumber` |
|
||||
| __`isObject`__ | Query returns an object (JSON object or XML node set) | `jsonpath "$.books[0]" isObject` |
|
||||
| __`isString`__ | Query returns a string | `jsonpath "$.name" isString` |
|
||||
| __`isUuid`__ | Query returns a [UUID v4] | `ip isUuid` |
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -239,12 +239,12 @@ $ TOMORROW=$(date '+%y%m%d' -d"+1days")
|
|||
$ hurl --variable "today=$TODAY" --variable "tomorrow=$TOMORROW" test.hurl
|
||||
```
|
||||
|
||||
You can also use environment variables that begins with `HURL_` to inject data in an Hurl file.
|
||||
You can also use environment variables that begins with `HURL_VARIABLE_` to inject data in an Hurl file.
|
||||
For instance, to inject `today` and `tomorrow` variables:
|
||||
|
||||
```shell
|
||||
$ export HURL_today=$(date '+%y%m%d')
|
||||
$ export HURL_tomorrow=$(date '+%y%m%d' -d"+1days")
|
||||
$ export HURL_VARIABLE_today=$(date '+%y%m%d')
|
||||
$ export HURL_VARIABLE_tomorrow=$(date '+%y%m%d' -d"+1days")
|
||||
$ hurl test.hurl
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -230,12 +230,13 @@ Environment variables can only be specified in lowercase.
|
|||
Using an environment variable to set the proxy has the same effect as using the [`-x, --proxy`](#proxy) option.
|
||||
|
||||
| Variable | Description |
|
||||
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|--------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `http_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use for HTTP.<br> |
|
||||
| `https_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use for HTTPS.<br> |
|
||||
| `all_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use if no protocol-specific proxy is set.<br> |
|
||||
| `no_proxy <comma-separated list of hosts>` | List of host names that shouldn't go through any proxy.<br> |
|
||||
| `HURL_name value` | Define variable (name/value) to be used in Hurl templates. This is similar than [`--variable`](#variable) and [`--variables-file`](#variables-file) options.<br> |
|
||||
| `HURL_VARIABLE_name value` | Define variable (name/value) to be used in Hurl templates. This is similar to [`--variable`](#variable) and [`--variables-file`](#variables-file) options.<br> |
|
||||
| `HURL_SECRET_name value` | Define secret (name/value) to be used in Hurl templates. This is similar to [`--secret`](#secret) and [`--secrets-file`](#secrets-file) options.<br> |
|
||||
| `NO_COLOR` | When set to a non-empty string, do not colorize output (see [`--no-color`](#no-color) option).<br> |
|
||||
|
||||
## Exit Codes
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.TH hurl 1 "10 Oct 2025" "hurl 7.1.0-SNAPSHOT" " Hurl Manual"
|
||||
.TH hurl 1 "10 Nov 2025" "hurl 7.1.0-SNAPSHOT" " Hurl Manual"
|
||||
.SH NAME
|
||||
|
||||
hurl - run and test HTTP requests.
|
||||
|
|
@ -592,9 +592,13 @@ Sets the proxy server to use if no protocol-specific proxy is set.
|
|||
|
||||
List of host names that shouldn't go through any proxy.
|
||||
|
||||
.IP "HURL_name value"
|
||||
.IP "HURL_VARIABLE_name value"
|
||||
|
||||
Define variable (name/value) to be used in Hurl templates. This is similar than \fI--variable\fP and \fI--variables-file\fP options.
|
||||
Define variable (name/value) to be used in Hurl templates. This is similar to \fI--variable\fP and \fI--variables-file\fP options.
|
||||
|
||||
.IP "HURL_SECRET_name value"
|
||||
|
||||
Define secret (name/value) to be used in Hurl templates. This is similar to \fI--secret\fP and \fI--secrets-file\fP options.
|
||||
|
||||
.IP "NO_COLOR"
|
||||
|
||||
|
|
|
|||
|
|
@ -611,9 +611,13 @@ Sets the proxy server to use if no protocol-specific proxy is set.
|
|||
|
||||
List of host names that shouldn't go through any proxy.
|
||||
|
||||
### HURL_name value
|
||||
### HURL_VARIABLE_name value
|
||||
|
||||
Define variable (name/value) to be used in Hurl templates. This is similar than [`--variable`](#variable) and [`--variables-file`](#variables-file) options.
|
||||
Define variable (name/value) to be used in Hurl templates. This is similar to [`--variable`](#variable) and [`--variables-file`](#variables-file) options.
|
||||
|
||||
### HURL_SECRET_name value
|
||||
|
||||
Define secret (name/value) to be used in Hurl templates. This is similar to [`--secret`](#secret) and [`--secrets-file`](#secrets-file) options.
|
||||
|
||||
### NO_COLOR
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.TH hurl 1 "10 Oct 2025" "hurl 7.1.0-SNAPSHOT" " Hurl Manual"
|
||||
.TH hurl 1 "10 Nov 2025" "hurl 7.1.0-SNAPSHOT" " Hurl Manual"
|
||||
.SH NAME
|
||||
|
||||
hurlfmt - format Hurl files
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ To use variables in your tests, you can:
|
|||
|
||||
- use [`--variable` option]
|
||||
- use [`--variables-file` option]
|
||||
- define environment variables, for instance `HURL_foo=bar`
|
||||
- define environment variables, for instance `HURL_VARIABLE_foo=bar`
|
||||
|
||||
You will find a detailed description in the [Injecting Variables] section of the docs.
|
||||
|
||||
|
|
|
|||
|
|
@ -433,6 +433,7 @@ screencapability: low
|
|||
HTTP 200
|
||||
[Asserts]
|
||||
jsonpath "$.validated" == true
|
||||
jsonpath "$.userInfo" isObject
|
||||
jsonpath "$.userInfo.firstName" == "Franck"
|
||||
jsonpath "$.userInfo.lastName" == "Herbert"
|
||||
jsonpath "$.hasDevice" == false
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ As of Hurl 5.0.1, the way to define variables in Hurl are:
|
|||
id=1234
|
||||
```
|
||||
|
||||
- Environment variable prefixed by `HURL_`
|
||||
export HURL_host=example.net
|
||||
export HURL_id=1234
|
||||
- Environment variable prefixed by `HURL_VARIABLE_`
|
||||
export HURL_VARIABLE_host=example.net
|
||||
export HURL_VARIABLE_id=1234
|
||||
hurl test.hurl
|
||||
- `[Options]` section, inside a Hurl file
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ Variables can be injected in a Hurl file:
|
|||
|
||||
- by using [`--variable` option]
|
||||
- by using [`--variables-file` option]
|
||||
- by defining environment variables, for instance `HURL_foo=bar`
|
||||
- by defining environment variables, for instance `HURL_VARIABLE_foo=bar`
|
||||
- by defining variables in an [`[Options]` section][options]
|
||||
|
||||
Lets' see how to inject variables, given this `test.hurl`:
|
||||
|
|
@ -189,11 +189,11 @@ id=1234
|
|||
|
||||
### Environment variable
|
||||
|
||||
We can use environment variables in the form of `HURL_name=value`:
|
||||
We can use environment variables in the form of `HURL_VARIABLE_name=value`:
|
||||
|
||||
```shell
|
||||
$ export HURL_host=example.net
|
||||
$ export HURL_id=1234
|
||||
$ export HURL_VARIABLE_host=example.net
|
||||
$ export HURL_VARIABLE_id=1234
|
||||
$ hurl test.hurl
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -708,6 +708,7 @@ screencapability: low
|
|||
HTTP 200
|
||||
[Asserts]
|
||||
jsonpath "$.validated" == true
|
||||
jsonpath "$.userInfo" isObject
|
||||
jsonpath "$.userInfo.firstName" == "Franck"
|
||||
jsonpath "$.userInfo.lastName" == "Herbert"
|
||||
jsonpath "$.hasDevice" == false
|
||||
|
|
@ -1521,12 +1522,13 @@ Environment variables can only be specified in lowercase.
|
|||
Using an environment variable to set the proxy has the same effect as using the [`-x, --proxy`](#proxy) option.
|
||||
|
||||
| Variable | Description |
|
||||
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|--------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `http_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use for HTTP.<br> |
|
||||
| `https_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use for HTTPS.<br> |
|
||||
| `all_proxy [PROTOCOL://]<HOST>[:PORT]` | Sets the proxy server to use if no protocol-specific proxy is set.<br> |
|
||||
| `no_proxy <comma-separated list of hosts>` | List of host names that shouldn't go through any proxy.<br> |
|
||||
| `HURL_name value` | Define variable (name/value) to be used in Hurl templates. This is similar than [`--variable`](#variable) and [`--variables-file`](#variables-file) options.<br> |
|
||||
| `HURL_VARIABLE_name value` | Define variable (name/value) to be used in Hurl templates. This is similar to [`--variable`](#variable) and [`--variables-file`](#variables-file) options.<br> |
|
||||
| `HURL_SECRET_name value` | Define secret (name/value) to be used in Hurl templates. This is similar to [`--secret`](#secret) and [`--secrets-file`](#secrets-file) options.<br> |
|
||||
| `NO_COLOR` | When set to a non-empty string, do not colorize output (see [`--no-color`](#no-color) option).<br> |
|
||||
|
||||
## Exit Codes
|
||||
|
|
|
|||
Loading…
Reference in New Issue