Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jsonpath "$.books" count == 12
| [base64UrlSafeDecode](#base64urlsafedecode) | Decodes a Base64 encoded string into bytes (using [Base64 URL safe encoding]). | string | bytes |
| [base64UrlSafeEncode](#base64urlsafeencode) | Encodes bytes into Base64 encoded string (using [Base64 URL safe encoding]). | bytes | string |
| [count](#count) | Counts the number of items in a collection. | collection | number |
| [dateFormat](#dateformat) | Formats a date to a string given [a specification format]. | date | string |
| [daysAfterNow](#daysafternow) | Returns the number of days between now and a date in the future. | date | number |
| [daysBeforeNow](#daysbeforenow) | Returns the number of days between now and a date in the past. | date | number |
| [decode](#decode) | Decodes bytes to string using encoding. | bytes | string |
| [first](#first) | Returns the first element from a collection. | collection | any |
| [dateFormat](#dateFormat) | Formats a date to a string given [a specification format]. | date | string |
| [htmlEscape](#htmlescape) | Converts the characters `&`, `<` and `>` to HTML-safe sequence. | string | string |
| [htmlUnescape](#htmlunescape) | Converts all named and numeric character references (e.g. `&gt;`, `&#62;`, `&#x3e;`) to the corresponding Unicode characters. | string | string |
| [jsonpath](#jsonpath) | Evaluates a [JSONPath] expression. | string | any |
Expand Down Expand Up @@ -148,6 +148,19 @@ HTTP 200
jsonpath "$.books" count == 12
```

### dateFormat

*Formerly known as `format`, which is deprecated and will be removed in a future major version.*

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

```hurl
GET https://example.org
HTTP 200
[Asserts]
cookie "LSID[Expires]" dateFormat "%a, %d %b %Y %H:%M:%S" == "Wed, 13 Jan 2021 22:23:01"
```

### daysAfterNow

Returns the number of days between now and a date in the future.
Expand Down Expand Up @@ -196,19 +209,6 @@ HTTP 200
jsonpath "$.books" first == "Dune"
```

### dateFormat

*Formerly known as `format`, which is deprecated and will be removed in a future major version.*

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

```hurl
GET https://example.org
HTTP 200
[Asserts]
cookie "LSID[Expires]" dateFormat "%a, %d %b %Y %H:%M:%S" == "Wed, 13 Jan 2021 22:23:01"
```

### htmlEscape

Converts the characters `&`, `<` and `>` to HTML-safe sequence.
Expand Down Expand Up @@ -477,5 +477,5 @@ bytes decode "gb2312" xpath "string(//body)" == "你好世界"
[JSONPath]: https://goessner.net/articles/JsonPath/
[Base64 encoded string]: https://datatracker.ietf.org/doc/html/rfc4648#section-4
[Base64 URL safe encoding]: https://datatracker.ietf.org/doc/html/rfc4648#section-5
[Encoding labels]: https://encoding.spec.whatwg.org/]https://encoding.spec.whatwg.org/#concept-encoding-get
[Encoding Standard]: https://encoding.spec.whatwg.org/]https://encoding.spec.whatwg.org/#concept-encoding-get

18 changes: 2 additions & 16 deletions docs/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,18 +453,6 @@ POST https://example.org/api/cats
}
```

Escapes are not processed (and particularly [Hurl Unicode literals] are not supported): `\n` is two consecutive
chars (`\` followed by a `n`), not a single newline char:

```hurl
# Create a new catty thing with JSON body:
POST https://example.org/api/cats
{
"text1": "\n is two chars \ and n",
"text2": "\u{1D11E} is nine chars"
}
```


When using JSON request body, the content type `application/json` is automatically set.

Expand Down Expand Up @@ -520,8 +508,6 @@ SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
</soap:Envelope>
~~~

Like JSON body, escapes are not processed (`\n` is two consecutive `\` followed by a `n`).

XML request body can be seen as syntactic sugar of [multiline string body] with `xml` identifier:

~~~hurl
Expand Down Expand Up @@ -633,8 +619,8 @@ Multiline string body can be [templatized with variables]:
~~~hurl
POST https://example.org/models
[Options]
var1: lemon
var2: yellow
variable: var1=lemon
variable: var2=yellow
```
Fruit,Color
{{var1}},{{var2}}
Expand Down
Loading