You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bytes startsWith hex,48656c6c6f; # decompressed content starts with "Hello"
701
+
```
702
+
703
+
Unlike `bytes` assert, `rawbytes` returns the raw bytes _before_ any content decoding. For uncompressed responses, `rawbytes` and `bytes` return the same data.
704
+
684
705
### XPath assert
685
706
686
707
Check the value of a [XPath] query on the received HTTP body decoded as a string (using the `charset` value in the
@@ -972,7 +993,8 @@ duration < 1000 # Check that response time is less than one second
972
993
Check the SSL certificate properties. Certificate assert consists of the keyword `certificate`, followed by the
973
994
certificate attribute value.
974
995
975
-
The following attributes are supported: `Subject`, `Issuer`, `Start-Date`, `Expire-Date` and `Serial-Number`.
996
+
The following attributes are supported: `Subject`, `Issuer`, `Start-Date`, `Expire-Date`, `Serial-Number`,
Like `body` capture, `bytes` capture works _after_ content encoding decompression (so the captured value is not
199
200
affected by `Content-Encoding` response header).
200
201
202
+
### RawBytes capture
203
+
204
+
Capture the entire body as a raw bytestream from the received HTTP response, _before_ any content decoding.
205
+
206
+
```hurl
207
+
GET https://example.org/data.bin
208
+
HTTP 200
209
+
[Captures]
210
+
raw_data: rawbytes
211
+
```
212
+
213
+
Unlike `bytes` capture, `rawbytes` returns the raw bytes before content encoding decompression. For uncompressed responses, `rawbytes` and `bytes` capture the same data.
214
+
201
215
### XPath capture
202
216
203
217
Capture a [XPath] query from the received HTTP body decoded as a string.
@@ -423,7 +437,8 @@ duration_in_ms: duration
423
437
424
438
Capture the SSL certificate properties. Certificate capture consists of the keyword `certificate`, followed by the certificate attribute value.
425
439
426
-
The following attributes are supported: `Subject`, `Issuer`, `Start-Date`, `Expire-Date` and `Serial-Number`.
440
+
The following attributes are supported: `Subject`, `Issuer`, `Start-Date`, `Expire-Date`, `Serial-Number`,
|[charsetDecode](#charsetdecode)| Decodes bytes to string using a charset encoding. | bytes | string |
74
75
|[count](#count)| Counts the number of items in a collection. | collection | number |
75
76
|[dateFormat](#dateformat)| Formats a date to a string given [a specification format]. | date | string |
76
77
|[daysAfterNow](#daysafternow)| Returns the number of days between now and a date in the future. | date | number |
77
78
|[daysBeforeNow](#daysbeforenow)| Returns the number of days between now and a date in the past. | date | number |
78
-
|[decode](#decode)| Decodes bytes to string using encoding. | bytes | string |
79
79
|[first](#first)| Returns the first element from a collection. | collection | any |
80
80
|[htmlEscape](#htmlescape)| Converts the characters `&`, `<` and `>` to HTML-safe sequence. | string | string |
81
81
|[htmlUnescape](#htmlunescape)| Converts all named and numeric character references (e.g. `>`, `>`, `>`) to the corresponding Unicode characters. | string | string |
@@ -143,6 +143,23 @@ HTTP 200
143
143
bytes base64UrlSafeEncode == "PDw_Pz8-Pg"
144
144
```
145
145
146
+
### charsetDecode
147
+
148
+
Decodes bytes to string using a charset encoding. Encoding labels are defined in [Encoding Standard].
149
+
150
+
```hurl
151
+
# The 'Content-Type' HTTP response header does not precise the charset 'gb2312'
152
+
# so body must be decoded explicitly by Hurl before processing any text based assert
153
+
GET https://example.org/hello_china
154
+
HTTP 200
155
+
[Asserts]
156
+
header "Content-Type" == "text/html"
157
+
# Content-Type has no encoding clue, we must decode ourselves the body response.
0 commit comments