diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ff90ffa..ba60908 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,13 +25,9 @@ jobs: pip3 install --user -r ./sites/requirements.txt sudo gem install jekyll - name: Check style - run: | - cd sites - ./check_fmt.sh + run: sites/check_fmt.sh - name: Build - run: | - cd sites - ./build.sh + run: sites/build.sh - name: Publish if: github.ref == 'refs/heads/master' env: diff --git a/sites/build.sh b/sites/build.sh index a1b52ad..1d5cc70 100755 --- a/sites/build.sh +++ b/sites/build.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -eu +original_dir="$(pwd)" +cd "$(dirname "$0")" + function echo_step () { echo '' echo -e "\033[32m\033[1m$1...\033[0m" @@ -39,8 +42,9 @@ python3 build_sitemap.py > hurl.dev/_site/sitemap.txt echo_step 'Generating feed.xml' cp hurl.dev/_posts/feed.xml hurl.dev/_site/blog/ +sites_dir=$(realpath --relative-to="$original_dir" "$(pwd)") echo '' echo 'Run local site' echo '-------------------' -echo ' Build & watch: jekyll serve --source hurl.dev --destination hurl.dev/_site' -echo ' Static: python3 -m http.server --dir hurl.dev/_site 4000' +echo " Build & watch: jekyll serve --source $sites_dir/hurl.dev --destination $sites_dir/hurl.dev/_site" +echo " Static: python3 -m http.server --dir $sites_dir/hurl.dev/_site 4000" diff --git a/sites/build_home_samples.py b/sites/build_home_samples.py index 2a3aec3..95fc8c8 100755 --- a/sites/build_home_samples.py +++ b/sites/build_home_samples.py @@ -324,7 +324,7 @@ def make_home_samples(): """, ), Sample( - name="SSL Certificate", + name="SSL/TLS Certificate", src="""\ # Check attributes of the SSL certificate GET https://example.org @@ -334,6 +334,9 @@ def make_home_samples(): certificate "Issuer" == "C=US, O=Let's Encrypt, CN=R3" certificate "Expire-Date" daysAfterNow > 15 certificate "Serial-Number" matches /[\\da-f]+/ +certificate "Subject-Alt-Name" contains "DNS:example.org" +certificate "Subject-Alt-Name" split "," count == 2 +certificate "Value" startsWith "-----BEGIN CERTIFICATE-----" """, ), Sample( diff --git a/sites/hurl.dev/_data/docs.yml b/sites/hurl.dev/_data/docs.yml index 14d391a..9264546 100644 --- a/sites/hurl.dev/_data/docs.yml +++ b/sites/hurl.dev/_data/docs.yml @@ -48,8 +48,13 @@ items: - title: Capturing values - title: Asserts - - title: Options - - title: Environment + - title: Configuration + - title: All Options + items: + - title: HTTP options + - title: Output options + - title: Report options + - title: Other options - title: Exit Codes - title: WWW - title: See Also @@ -211,6 +216,7 @@ - title: Cookie capture - title: Body capture - title: Bytes capture + - title: RawBytes capture - title: XPath capture - title: JSONPath capture - title: Regex capture @@ -250,6 +256,7 @@ - title: Cookie assert - title: Body assert - title: Bytes assert + - title: RawBytes assert - title: XPath assert - title: JSONPath assert - title: Regex assert @@ -272,11 +279,11 @@ - title: base64Encode - title: base64UrlSafeDecode - title: base64UrlSafeEncode + - title: charsetDecode - title: count - title: dateFormat - title: daysAfterNow - title: daysBeforeNow - - title: decode - title: first - title: htmlEscape - title: htmlUnescape diff --git a/sites/hurl.dev/_docs/asserting-response.md b/sites/hurl.dev/_docs/asserting-response.md index 2a45f96..785dc6f 100644 --- a/sites/hurl.dev/_docs/asserting-response.md +++ b/sites/hurl.dev/_docs/asserting-response.md @@ -26,8 +26,8 @@ jsonpath "$.cats[0].name" == "Felix" jsonpath "$.cats[0].lives" == 9 ``` -Body responses can be encoded by server (see [`Content-Encoding` HTTP header]) but asserts in Hurl files are not -affected by this content compression. All body asserts (`body`, `bytes`, `sha256` etc...) work _after_ content decoding. +Body responses can be encoded by server (see [`Content-Encoding` HTTP header][content-encoding]) but asserts in Hurl files are not +affected by this content compression. All body asserts (`body`, `bytes`, `sha256` etc...) except `rawbytes` work _after_ content decoding. Finally, body text asserts (`body`, `jsonpath`, `xpath` etc...) are also decoded to strings based on [`Content-Type` header] so these asserts can be written with usual strings. @@ -92,6 +92,7 @@ The asserts order in a Hurl file is: + ## Implicit asserts ### Version - Status @@ -344,7 +345,7 @@ to specify the root directory of all file nodes. Optional list of assertions on the HTTP response within an `[Asserts]` section. Assertions can describe checks on status code, on the received body (or part of it) and on response headers. -Structure of an assert: +__Structure of an explicit assert:__
--aws-sigv4 <PROVIDER1[:PROVIDER2[:REGION[:SERVICE]]]> | Generate an `Authorization` header with an AWS SigV4 signature.--cacert <FILE> | Specifies the certificate file for peer verification. The file may contain multiple CA certificates and must be in PEM format.-E, --cert <CERTIFICATE[:PASSWORD]> | Client certificate file and password.--color | Colorize debug output (the HTTP response output is not colorized).--compressed | Request a compressed response using one of the algorithms br, gzip, deflate and automatically decompress the content.--connect-timeout <SECONDS> | Maximum time in seconds that you allow Hurl's connection to take.--connect-to <HOST1:PORT1:HOST2:PORT2> | For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead. This option can be used several times in a command line.--continue-on-error | Continue executing requests to the end of the Hurl file even when an assert error occurs.-b, --cookie <FILE> | Read cookies from FILE (using the Netscape cookie file format).-c, --cookie-jar <FILE> | Write cookies to FILE after running the session.--curl <FILE> | Export each request to a list of curl commands.--delay <MILLISECONDS> | Sets delay before each request (aka sleep). The delay is not applied to requests that have been retried because of [`--retry`](#retry). See [`--retry-interval`](#retry-interval) to space retried requests.--error-format <FORMAT> | Control the format of error message (short by default or long)--file-root <DIR> | Set root directory to import files in Hurl. This is used for files in multipart form data, request body and response output.--from-entry <ENTRY_NUMBER> | Execute Hurl file from ENTRY_NUMBER (starting at 1).--glob <GLOB> | Specify input files that match the given glob pattern.-H, --header <HEADER> | Add an extra header to include in information sent. Can be used several times in a command-0, --http1.0 | Tells Hurl to use HTTP version 1.0 instead of using its internally preferred HTTP version.--http1.1 | Tells Hurl to use HTTP version 1.1.--http2 | Tells Hurl to use HTTP version 2.--http3 | Tells Hurl to try HTTP/3 to the host in the URL, but fallback to earlier HTTP versions if the HTTP/3 connection establishment fails. HTTP/3 is only available for HTTPS and not for HTTP URLs.--ignore-asserts | Ignore all asserts defined in the Hurl file.-i, --include | Include the HTTP headers in the output-k, --insecure | This option explicitly allows Hurl to perform "insecure" SSL connections and transfers.-4, --ipv4 | This option tells Hurl to use IPv4 addresses only when resolving host names, and not for example try IPv6.-6, --ipv6 | This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4.--jobs <NUM> | Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the--json | Output each Hurl file result to JSON. The format is very closed to HAR format.--key <KEY> | Private key file name.--limit-rate <SPEED> | Specify the maximum transfer rate you want Hurl to use, for both downloads and uploads. This feature is useful if you have a limited pipe and you would like your transfer not to use your entire bandwidth. To make it slower than it otherwise would be.-L, --location | Follow redirect. To limit the amount of redirects to follow use the [`--max-redirs`](#max-redirs) option--location-trusted | Like [`-L, --location`](#location), but allows sending the name + password to all hosts that the site may redirect to.--max-filesize <BYTES> | Specify the maximum size in bytes of a file to download. If the file requested is larger than this value, the transfer does not start.--max-redirs <NUM> | Set maximum number of redirection-followings allowed-m, --max-time <SECONDS> | Maximum time in seconds that you allow a request/response to take. This is the standard timeout.--negotiate | Tell Hurl to use Negotiate (SPNEGO) authentication.-n, --netrc | Scan the .netrc file in the user's home directory for the username and password.--netrc-file <FILE> | Like [`--netrc`](#netrc), but provide the path to the netrc file.--netrc-optional | Similar to [`--netrc`](#netrc), but make the .netrc usage optional.--no-color | Do not colorize output.--no-output | Suppress output. By default, Hurl outputs the body of the last response.--no-pretty | Do not prettify response output for supported content type (JSON only for the moment). By default, output is prettified if--noproxy <HOST(S)> | Comma-separated list of hosts which do not use a proxy.--ntlm | Tell Hurl to use NTLM authentication-o, --output <FILE> | Write output to FILE instead of stdout. Use '-' for stdout in [Options] sections.--parallel | Run files in parallel.--path-as-is | Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that.--pinnedpubkey <HASHES> | When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, Hurl aborts the connection before sending or receiving any data.--pretty | Prettify response output for supported content type (JSON only for the moment). By default, JSON response is prettified if standard output is a terminal, and colorized, see[`--no-color`](#no-color) to format without color.--progress-bar | Display a progress bar in test mode. The progress bar is displayed only in interactive TTYs. This option forces the progress bar to be displayed even in non-interactive TTYs.-x, --proxy <[PROTOCOL://]HOST[:PORT]> | Use the specified proxy.--repeat <NUM> | Repeat the input files sequence NUM times, -1 for infinite loop. Given a.hurl, b.hurl, c.hurl as input, repeat two--report-html <DIR> | Generate HTML report in DIR.--report-json <DIR> | Generate JSON report in DIR.--report-junit <FILE> | Generate JUnit File.--report-tap <FILE> | Generate TAP report.--resolve <HOST:PORT:ADDR> | Provide a custom address for a specific host and port pair. Using this, you can make the Hurl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line.--retry <NUM> | Maximum number of retries, 0 for no retries, -1 for unlimited retries. Retry happens if any error occurs (asserts, captures, runtimes etc...).--retry-interval <MILLISECONDS> | Duration in milliseconds between each retry. Default is 1000 ms.--secret <NAME=VALUE> | Define secret value to be redacted from logs and report. When defined, secrets can be used as variable everywhere variables are used.--secrets-file <FILE> | Define a secrets file in which you define your secrets--ssl-no-revoke | (Windows) This option tells Hurl to disable certificate revocation checks. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that.--test | Activate test mode: with this, the HTTP response is not outputted anymore, progress is reported for each Hurl file tested, and a text summary is displayed when all files have been run.--to-entry <ENTRY_NUMBER> | Execute Hurl file to ENTRY_NUMBER (starting at 1).--unix-socket <PATH> | (HTTP) Connect through this Unix domain socket, instead of using the network.-u, --user <USER:PASSWORD> | Add basic Authentication header to each request.-A, --user-agent <NAME> | Specify the User-Agent string to send to the HTTP server.--variable <NAME=VALUE> | Define variable (name/value) to be used in Hurl templates.--variables-file <FILE> | Set properties file in which your define your variables.-v, --verbose | Turn on verbose output on standard error stream.--very-verbose | Turn on more verbose output on standard error stream.-h, --help | Usage help. This lists all current command line options with a short description.-V, --version | Prints version information--aws-sigv4 <PROVIDER1[:PROVIDER2[:REGION[:SERVICE]]]> | Generate an `Authorization` header with an AWS SigV4 signature.--cacert <FILE> | Specifies the certificate file for peer verification. The file may contain multiple CA certificates and must be in PEM format.-E, --cert <CERTIFICATE[:PASSWORD]> | Client certificate file and password.--compressed | Request a compressed response using one of the algorithms br, gzip, deflate and automatically decompress the content.--connect-timeout <SECONDS> | Maximum time in seconds that you allow Hurl's connection to take.--connect-to <HOST1:PORT1:HOST2:PORT2> | For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead. This option can be used several times in a command line.--digest | Tell Hurl to use HTTP Digest authentication-H, --header <NAME:VALUE> | Add an extra header to include in information sent. Can be used several times in a command.-0, --http1.0 | Tells Hurl to use HTTP version 1.0 instead of using its internally preferred HTTP version.--http1.1 | Tells Hurl to use HTTP version 1.1.--http2 | Tells Hurl to use HTTP version 2.--http3 | Tells Hurl to try HTTP version 3 to the host in the URL, but fallback to earlier HTTP versions if the HTTP/3 connection establishment fails. HTTP/3 is only available for HTTPS and not for HTTP URLs.-k, --insecure | This option explicitly allows Hurl to perform "insecure" SSL connections and transfers.-4, --ipv4 | This option tells Hurl to use IPv4 addresses only when resolving host names, and not for example try IPv6.-6, --ipv6 | This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4.--key <KEY> | Private key file name.--limit-rate <SPEED> | Specify the maximum transfer rate you want Hurl to use, for both downloads and uploads. This feature is useful if you have a limited pipe and you would like your transfer not to use your entire bandwidth. To make it slower than it otherwise would be.-L, --location | Follow redirect. To limit the amount of redirects to follow use the [`--max-redirs`](#max-redirs) option--location-trusted | Like [`-L, --location`](#location), but allows sending the name + password to all hosts that the site may redirect to.--max-filesize <BYTES> | Specify the maximum size in bytes of a file to download. If the file requested is larger than this value, the transfer does not start.--max-redirs <NUM> | Set maximum number of redirection-followings allowed-m, --max-time <SECONDS> | Maximum time in seconds that you allow a request/response to take. This is the standard timeout.--negotiate | Tell Hurl to use Negotiate (SPNEGO) authentication.--no-cookie-store | Do not use cookie storage for requests/responses in a file. By default, requests in the same Hurl file share cookie storage, this option deactivates cookie engine.--no-proxy <HOST(S)> | Comma-separated list of hosts which do not use a proxy.--ntlm | Tell Hurl to use NTLM authentication--path-as-is | Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that.--pinnedpubkey <HASHES> | When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, Hurl aborts the connection before sending or receiving any data.-x, --proxy <[PROTOCOL://]HOST[:PORT]> | Use the specified proxy.--resolve <HOST:PORT:ADDR> | Provide a custom address for a specific host and port pair. Using this, you can make the Hurl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line.--ssl-no-revoke | (Windows) This option tells Hurl to disable certificate revocation checks. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that.--unix-socket <PATH> | (HTTP) Connect through this Unix domain socket, instead of using the network.-u, --user <USER:PASSWORD> | Add basic Authentication header to each request.-A, --user-agent <NAME> | Specify the User-Agent string to send to the HTTP server.--color | Colorize standard output and standard error.--curl <FILE> | Export each request to a list of curl commands.--error-format <FORMAT> | Control the format of error message (short by default or long). When using long, the response body is logged when there are errors.-i, --include | Include the HTTP headers in the output--json | Output each Hurl file result to JSON. The format is very closed to HAR format.--no-color | Do not colorize standard output nor standard error.--no-output | Suppress output. By default, Hurl outputs the body of the last response.--no-pretty | Do not prettify response output for supported content type (JSON only for the moment). By default, output is prettified if-o, --output <FILE> | Write output to FILE instead of stdout. Use '-' for stdout in [Options] sections.--pretty | Prettify response output for supported content type (JSON only for the moment). By default, JSON response is prettified if standard output is a terminal, and colorized, see[`--no-color`](#no-color) to format without color.--progress-bar | Display a progress bar in test mode. The progress bar is displayed only in interactive TTYs. This option forces the progress bar to be displayed even in non-interactive TTYs.-v, --verbose | Turn on verbose output on standard error stream.--verbosity <LEVEL> | Set the verbosity level for debug logs on standard error stream (brief, verbose or debug)--very-verbose | Turn on more verbose output on standard error stream.--continue-on-error | Continue executing requests to the end of the Hurl file even when an assert error occurs. By default, Hurl exits after an assert error in the HTTP response.--delay <MILLISECONDS> | Sets delay before each request (aka sleep). The delay is not applied to requests that have been retried because of [`--retry`](#retry). See [`--retry-interval`](#retry-interval) to space retried requests.--from-entry <ENTRY_NUMBER> | Execute Hurl file from ENTRY_NUMBER (starting at 1).--jobs <NUM> | Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the current amount of CPUs. Set to 1 to disable parallel execution of files.--no-assert | Ignore all asserts defined in the Hurl file.--parallel | Run files in parallel.--repeat <NUM> | Repeat the input files sequence NUM times, -1 for infinite loop. Given a.hurl, b.hurl, c.hurl as input, repeat two--retry <NUM> | Maximum number of retries, 0 for no retries, -1 for unlimited retries. Retry happens if any error occurs (asserts, captures, runtimes etc...).--retry-interval <MILLISECONDS> | Duration in milliseconds between each retry. Default is 1000 ms.--secret <NAME=VALUE> | Define secret value to be redacted from logs and report. When defined, secrets can be used as variable everywhere variables are used.--secrets-file <FILE> | Define a secrets file in which you define your secrets--test | Activate test mode: with this, the HTTP response is not outputted anymore, progress is reported for each Hurl file tested, and a text summary is displayed when all files have been run.--to-entry <ENTRY_NUMBER> | Execute Hurl file to ENTRY_NUMBER (starting at 1).--variable <NAME=VALUE> | Define variable (name/value) to be used in Hurl templates.--variables-file <FILE> | Set properties file in which your define your variables.--report-html <DIR> | Generate HTML report in DIR.--report-json <DIR> | Generate JSON report in DIR.--report-junit <FILE> | Generate JUnit File.--report-tap <FILE> | Generate TAP report.-b, --cookie <FILE> | Read cookies from FILE (using the Netscape cookie file format).-c, --cookie-jar <FILE> | Write cookies to FILE after running the session.--file-root <DIR> | Set root directory to import files in Hurl. This is used for files in multipart form data, request body and response output.--glob <GLOB> | Specify input files that match the given glob pattern.-n, --netrc | Scan the .netrc file in the user's home directory for the username and password.--netrc-file <FILE> | Like [`--netrc`](#netrc), but provide the path to the netrc file.--netrc-optional | Similar to [`--netrc`](#netrc), but make the .netrc usage optional.-h, --help | Usage help. This lists all current command line options with a short description.-V, --version | Prints version informationThe Hurl team is thrilled to announce Hurl 8.0.0!
+




The Hurl team is thrilled to announce Hurl 8.0.0!
+
Hurl is a command line tool powered by curl, that runs HTTP requests defined in a simple plain text format:
+GET https://example.org/api/tests/4567
+HTTP 200
+[Asserts]
+jsonpath "$.status" == "RUNNING" # Check the status code
+jsonpath "$.tests" count == 25 # Check the number of items
+jsonpath "$.id" matches /\d{4}/ # Check the format of the id
+
+
+POST https://example.org/api/tests
+{
+ "name": "foo"
+}
+HTTP 201
+[Asserts]
+header "x-foo" contains "bar"
+certificate "Expire-Date" daysAfterNow > 15
+ip == "2001:0db8:85a3:0000:0000:8a2e:0370:733"
+
+In Feb 2024, the JSONPath RFC (RFC 9535) standard was published, 17 years after Stefan Gössner wrote his +influential blog post JSONPath – XPath for JSON that resulted in some 50 implementations in various languages (with, +unfortunately, differences among them).
+When the JSONPath was originally introduced in Hurl, no formal specification existed, the only reference was the original +article from goessner.net, and we based our code on it.
+With Hurl 8.0.0, the star of the show is our full RFC 9535 implementation!
+You can now write more powerful queries such as $[?length(@.authors) >= 5] or
+$.store.book[?(@.category == 'fiction' && @.price >= 10)]
RFC 9535 also defines functions length, count, match, search and value:
GET http://localhost:8000/jsonpath/function
+HTTP 200
+[Asserts]
+jsonpath "$.items[?length(@.name) > 3]" count == 2
+jsonpath "$.items[?count(@.tags) == 1]" count == 3
+jsonpath "$.items[?match(@.name, '^ca.*')].name" == "car"
+jsonpath "$.items[?search(@.name, 'ca')].name" == "car"
+jsonpath "$.items[?search(@.name, $.string)].name" == "car"
+jsonpath "$.items[?value(@.heavy) == true]" count == 2
+
+Combining filters and booleans expression is now possible:
+GET http://localhost:8000/json/store
+HTTP 200
+[Asserts]
+jsonpath "$.store.book[?(@.published==true)].title" == "Moby Dick" # filter on published books
+jsonpath "$.store.book[?(@.category == 'fiction' && @.price >= 10)]" count == 2 # filter all fiction books with price >= 10
+
+With this brand-new implementation, JSONPath results in Hurl have been standardized and aligned with +other queries (like XPath).
+JSONPath queries always return arrays, the Hurl jsonpath filter/query now maps the results as follows:
+jsonpath "$.store.book[5].title" not exists
jsonpath "$.store.book[1].title" == "Sword of Honour"
jsonpath "$.store.book[0,2]" count == 2
Unfortunately, this new RFC 9535 support forces us to make breaking changes. While most of the +existing JSONPath queries works without any modification in your Hurl files when upgrading to 8.0.0, +you might have some changes to make.
+Notably, ‘-’ in keypath: it’s not supported by the new spec and this kind of JSONPath
+$.headers.X-Custom
must be rewritten as
+$.headers['X-Custom']
For instance, before Hurl 8.0.0:
+GET http://localhost:8000/json/store
+HTTP 200
+[Asserts]
+jsonpath "$.not-exist" count == 5
+jsonpath "$.not-exist" startsWith "foo"
+jsonpath "$.not-exist" endsWith "foo"
+
+With Hurl 8.0.0:
+GET http://localhost:8000/json/store
+HTTP 200
+[Asserts]
+jsonpath "$['not-exist']" count == 5
+jsonpath "$['not-exist']" startsWith "foo"
+jsonpath "$['not-exist']" endsWith "foo"
+
+You can test the validity of your JSONPath expression with https://jsonpath.com, selecting RFC 9535:
+
Finally, our new JSONPath evaluation might also break existing tests written for previous versions.
+For example:
+jsonpath "$..book[5:7].title" count == 0
If there are only 4 books, this query now returns no value instead of an empty array. You will therefore get the following +error:
+error: Filter error
+ --> /tmp/test.hurl:4:31
+ |
+ | GET http://localhost:8000/books.json
+ | ...
+ 4 | jsonpath "$..book[5:7].title" count == 0
+ | ^^^^^ missing value to apply filter
+ |
+
+You must fix the assertion as follows:
+jsonpath "$..book[5:7].title" not exists
Because of the potential breaking changes, we’re trying to contact public repos on GitHub that are using Hurl when we +detect that they may have some changes to make for Hurl 8.0.0. Usually the changes are simple so this should not be a +big issue. In exchange, we hope that the new RFC 9535 will give you some useful new test capabilities.
+Not specifically tied to this new 8.0.0 version, but Hurl is now an official language on GitHub!
+You can search for Hurl snippets:
+
Repo top languages shows Hurl support:
+
And Hurl code is syntactically colored:
+
Thanks to Niklas Mollenhauer (@nikee) and all other people that have made this possible, you rock!
+Hurl options can be used in command line like --location to follow redirection, and overridden per request in [Options]
+section. For instance, this Hurl file:
GET https://example.org
+HTTP 301
+
+GET https://example.org
+[Options]
+location: true
+HTTP 200
+
+will follow a redirection only for the second entry.
+With Hurl 8.0.0, most of the options can also be defined with environment variables (like HURL_INSECURE for --insecure).
+So, in order to configure Hurl, there are three sources from the lowest priority (most easily overridden) to highest
+(overrides all others):
HURL_INSECURE)--insecure)insecure: true in file)You can check the Hurl manual to see all the configurable environment variables, there are plenty (i.e. HURL_COMPRESSED,
+HURL_CONNECT_TIMEOUT, HURL_HEADER, HURL_HTTP3 etc...)
By default, requests in the same Hurl file share cookie storage. A new option --no-cookie-store
+deactivates cookie engine allowing you to test cookie-less workflows. And you can configure it by environment variable
+with export HURL_NO_COOKIE_STORE=1.
Certificate queries allow you to assert and capture TLS/SSL certificates attributes like: subject, issue, start date, +expire date and serial number. With Hurl 8.0.0, you can now get subject alternative name and certificate value.
+GET https://example.org
+HTTP 200
+[Asserts]
+certificate "Subject" == "CN=example.org"
+certificate "Issuer" == "C=US, O=Let's Encrypt, CN=R3"
+certificate "Expire-Date" daysAfterNow > 15
+certificate "Serial-Number" matches "[0-9af]+"
+certificate "Subject-Alt-Name" contains "DNS:example.org"
+certificate "Subject-Alt-Name" split "," count == 2
+certificate "Value" startsWith "-----BEGIN CERTIFICATE-----"
+
+Making a JSON body request in Hurl is super simple, you just have to write a JSON body without any modification and it will be
+sent as is, with the right application/json Content-Type header. With this body, templates are also supported, in order
+to set variations on your requests.
POST https://example.org/api/cats
+{
+ "id": 42,
+ "name": "{{ name }}"
+}
+
+{{name}} is evaluated as a template and the file will fail if there is no name variable.
With Hurl 8.0.0, you can disable variable rendering and send {{ foo }} as it is, without Hurl trying to render it with
+ a variable. Using multiline string body and raw identifier you can send an unmodified body over the wire.
POST https://example.org/api/cats
+Content-Type: application/json
+```raw
+{
+ "id": 42,
+ "name": "{{ name }}"
+}
+```
+
+Without the raw identifier, the body will be a classic multiline body and will render every variable.
HTTP body responses can be encoded by server but captures and asserts in Hurl files are not affected by the content +compression. In Hurl, captures and asserts work automatically on the decompressed response body, as if there weren’t +any compression.
+Unlike bytes query, the new rawbytes query returns the raw bytes before any content decoding. For uncompressed responses, rawbytes
+and bytes return the same data.
GET https://example.org/data.bin
+HTTP 200
+Content-Encoding: gzip
+[Asserts]
+header "Content-Length" == "32"
+rawbytes count == 32 # matches Content-Length (compressed size)
+bytes count == 100 # decompressed size is larger
+rawbytes startsWith hex,1f8b; # gzip magic bytes
+bytes startsWith hex,48656c6c6f; # decompressed content starts with "Hello"
+
+That’s all for today!
+There are a lot of other improvements with Hurl 8.0.0 and also a lot of bug fixes, you can check the complete list of +enhancements and bug fixes in our release note.
+If you like Hurl, don’t hesitate to support us with a star on GitHub and share it on 𝕏 / Twitter and Bluesky!
+We’ll be happy to hear from you, either for enhancement requests or for sharing your success story using Hurl!
]]>