Skip to content

Commit b09781d

Browse files
committed
Update fro Hurl 7.1.0
1 parent 19c5627 commit b09781d

File tree

11 files changed

+206
-164
lines changed

11 files changed

+206
-164
lines changed

sites/hurl.dev/_docs/asserting-response.md

Lines changed: 25 additions & 24 deletions
Large diffs are not rendered by default.

sites/hurl.dev/_docs/filters.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jsonpath "$.books" count == 12
7676
| [daysBeforeNow](#daysbeforenow) | Returns the number of days between now and a date in the past. | date | number |
7777
| [decode](#decode) | Decodes bytes to string using encoding. | bytes | string |
7878
| [first](#first) | Returns the first element from a collection. | collection | any |
79-
| [format](#format) | Formats a date to a string given [a specification format]. | date | string |
79+
| [dateFormat](#dateFormat) | Formats a date to a string given [a specification format]. | date | string |
8080
| [htmlEscape](#htmlescape) | Converts the characters `&`, `<` and `>` to HTML-safe sequence. | string | string |
8181
| [htmlUnescape](#htmlunescape) | Converts all named and numeric character references (e.g. `&gt;`, `&#62;`, `&#x3e;`) to the corresponding Unicode characters. | string | string |
8282
| [jsonpath](#jsonpath) | Evaluates a [JSONPath] expression. | string | any |
@@ -95,6 +95,8 @@ jsonpath "$.books" count == 12
9595
| [urlDecode](#urldecode) | Replaces %xx escapes with their single-character equivalent. | string | string |
9696
| [urlEncode](#urlencode) | Percent-encodes all the characters which are not included in unreserved chars (see [RFC3986]) with the exception of forward slash (/). | string | string |
9797
| [urlQueryParam](#urlqueryparam) | Returns the value of a query parameter in a URL. | string | string |
98+
| [utf8Decode](#utf8Decode) | Decodes bytes to string using UTF-8 encoding. | bytes | string |
99+
| [utf8Encode](#utf8Encode) | Encodes a string to bytes using UTF-8 encoding. | string | bytes |
98100
| [xpath](#xpath) | Evaluates a [XPath] expression. | string | string |
99101

100102
### base64Decode
@@ -176,7 +178,7 @@ certificate "Start-Date" daysBeforeNow < 100
176178

177179
### decode
178180

179-
Decodes bytes to string using encoding.
181+
Decodes bytes to string using encoding. Encoding labels are defined in [Encoding Standard].
180182

181183
```hurl
182184
# The 'Content-Type' HTTP response header does not precise the charset 'gb2312'
@@ -200,15 +202,17 @@ HTTP 200
200202
jsonpath "$.books" first == "Dune"
201203
```
202204

203-
### format
205+
### dateFormat
206+
207+
*Formerly known as `format`, which is deprecated and will be removed in a future major version.*
204208

205209
Formats a date to a string given [a specification format].
206210

207211
```hurl
208212
GET https://example.org
209213
HTTP 200
210214
[Asserts]
211-
cookie "LSID[Expires]" format "%a, %d %b %Y %H:%M:%S" == "Wed, 13 Jan 2021 22:23:01"
215+
cookie "LSID[Expires]" dateFormat "%a, %d %b %Y %H:%M:%S" == "Wed, 13 Jan 2021 22:23:01"
212216
```
213217

214218
### htmlEscape
@@ -356,8 +360,8 @@ GET https://example.org/api/books
356360
HTTP 200
357361
[Asserts]
358362
jsonpath "$.published" == "2023-01-23T18:25:43.511Z"
359-
jsonpath "$.published" toDate "%Y-%m-%dT%H:%M:%S%.fZ" format "%A" == "Monday"
360-
jsonpath "$.published" toDate "%+" format "%A" == "Monday" # %+ can be used to parse ISO 8601 / RFC 3339
363+
jsonpath "$.published" toDate "%Y-%m-%dT%H:%M:%S%.fZ" dateFormat "%A" == "Monday"
364+
jsonpath "$.published" toDate "%+" dateFormat "%A" == "Monday" # %+ can be used to parse ISO 8601 / RFC 3339
361365
```
362366

363367
### toFloat
@@ -417,7 +421,7 @@ jsonpath "$.encoded_url" urlDecode == "https://mozilla.org/?x=шеллы"
417421

418422
### urlEncode
419423

420-
Percent-encodes all the characters which are not included in unreserved chars (see [RFC3986]) with the exception of forward slash (/).
424+
Percent-encodes all the characters which are not included in unreserved chars (see [RFC3986]) except forward slash (/).
421425

422426
```hurl
423427
GET https://example.org/foo
@@ -437,6 +441,29 @@ HTTP 200
437441
jsonpath "$.url" urlQueryParam "x" == "шеллы"
438442
```
439443

444+
### utf8Decode
445+
446+
Decodes bytes to string using UTF-8 encoding.
447+
448+
```hurl
449+
GET https://example.org/messages
450+
HTTP 200
451+
[Asserts]
452+
# From a Base64 string to UTF-8 bytes to final string
453+
jsonpath "$.bytesInBase64" base64Decode utf8Decode == "Hello World"
454+
```
455+
456+
### utf8Encode
457+
458+
Encodes a string to bytes using UTF-8 encoding.
459+
460+
```hurl
461+
GET https://example.org/drinks
462+
HTTP 200
463+
[Asserts]
464+
jsonpath "$.beverage" utf8Encode toHex == "636166C3A9"
465+
```
466+
440467
### xpath
441468

442469
Evaluates a [XPath] expression.
@@ -457,3 +484,4 @@ bytes decode "gb2312" xpath "string(//body)" == "你好世界"
457484
[JSONPath]: https://goessner.net/articles/JsonPath/
458485
[Base64 encoded string]: https://datatracker.ietf.org/doc/html/rfc4648#section-4
459486
[Base64 URL safe encoding]: https://datatracker.ietf.org/doc/html/rfc4648#section-5
487+
[Encoding labels]: https://encoding.spec.whatwg.org/]https://encoding.spec.whatwg.org/#concept-encoding-get

sites/hurl.dev/_docs/frequently-asked-questions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ $ TOMORROW=$(date '+%y%m%d' -d"+1days")
248248
$ hurl --variable "today=$TODAY" --variable "tomorrow=$TOMORROW" test.hurl
249249
```
250250

251-
You can also use environment variables that begins with `HURL_` to inject data in an Hurl file.
251+
You can also use environment variables that begins with `HURL_VARIABLE_` to inject data in an Hurl file.
252252
For instance, to inject `today` and `tomorrow` variables:
253253

254254
```shell
255-
$ export HURL_today=$(date '+%y%m%d')
256-
$ export HURL_tomorrow=$(date '+%y%m%d' -d"+1days")
255+
$ export HURL_VARIABLE_today=$(date '+%y%m%d')
256+
$ export HURL_VARIABLE_tomorrow=$(date '+%y%m%d' -d"+1days")
257257
$ hurl test.hurl
258258
```
259259

0 commit comments

Comments
 (0)