2022-09-02 11:50:43 +03:00
|
|
|
# Variables can be set from:
|
|
|
|
# - an external properties file
|
|
|
|
# - at the command-line with the --variable option
|
2022-09-07 20:12:25 +03:00
|
|
|
# - with HURL_xxx environment variable
|
2022-09-02 11:50:43 +03:00
|
|
|
# - in the Hurl File in the [Options] section
|
|
|
|
|
2021-01-09 12:25:01 +03:00
|
|
|
POST http://localhost:8000/variables
|
2021-09-10 18:35:23 +03:00
|
|
|
Name: {{name}}
|
|
|
|
Age: {{age}}
|
|
|
|
Height: {{height}}
|
|
|
|
Female: {{female}}
|
|
|
|
Id: {{my-id}}
|
|
|
|
A_Null: {{a_null}}
|
2022-09-02 11:50:43 +03:00
|
|
|
Country: {{country}}
|
2023-01-03 19:43:13 +03:00
|
|
|
Planet: {{planet}}
|
2023-01-18 15:47:31 +03:00
|
|
|
Galaxy: {{galaxy}}
|
2022-09-02 11:50:43 +03:00
|
|
|
[Options]
|
|
|
|
variable: country=Italy
|
2023-01-03 19:43:13 +03:00
|
|
|
variable: planet=The Earth
|
2021-01-09 12:25:01 +03:00
|
|
|
{
|
|
|
|
"name": "{{name}}",
|
|
|
|
"age": {{age}},
|
2021-02-25 22:33:14 +03:00
|
|
|
"height": {{height}},
|
|
|
|
"female": {{female}},
|
2021-09-10 18:35:23 +03:00
|
|
|
"id": "{{my-id}}",
|
2022-09-02 11:50:43 +03:00
|
|
|
"a_null": {{a_null}},
|
2023-01-03 19:43:13 +03:00
|
|
|
"country": "{{country}}",
|
2023-01-18 15:47:31 +03:00
|
|
|
"planet": "{{planet}}",
|
|
|
|
"galaxy": "{{galaxy}}"
|
2021-01-09 12:25:01 +03:00
|
|
|
}
|
2021-02-25 22:33:14 +03:00
|
|
|
|
2022-11-11 16:25:00 +03:00
|
|
|
HTTP 200
|
2021-02-25 22:33:14 +03:00
|
|
|
[Asserts]
|
2022-03-28 19:04:35 +03:00
|
|
|
variable "name" == "Jennifer"
|
|
|
|
variable "female" == true
|
|
|
|
variable "age" == 30
|
|
|
|
variable "height" == 1.70
|
|
|
|
variable "a_null" == null
|
|
|
|
variable "my-id" == "123"
|
2022-10-24 12:37:11 +03:00
|
|
|
variable "country" == "Italy"
|
2023-01-03 19:43:13 +03:00
|
|
|
variable "planet" == "The Earth"
|
2023-01-18 15:47:31 +03:00
|
|
|
variable "galaxy" == "Milky Way"
|
2023-01-03 19:43:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
# `country` and `planet` variable are still available
|
|
|
|
# for the next entries, even if they've been defined in the
|
|
|
|
# previous `[Options]` request section.
|
|
|
|
GET http://localhost:8000/variable/country
|
|
|
|
HTTP 200
|
|
|
|
`{{country}}`
|
|
|
|
|
|
|
|
GET http://localhost:8000/variable/planet
|
|
|
|
HTTP 200
|
|
|
|
`{{planet}}`
|