Skip to content

Commit

Permalink
Update doc for 4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel committed Jan 10, 2024
1 parent 5b665dc commit 7bfae0a
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 173 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Hurl makes it easy to work with <b>HTML</b> content, <b>REST / SOAP / GraphQL</b
```hurl
# Get home:
GET https://example.org
HTTP 200
[Captures]
csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)"
Expand Down Expand Up @@ -59,7 +58,6 @@ POST https://example.org/api/tests
"id": "4568",
"evaluate": true
}
HTTP 200
[Asserts]
header "X-Frame-Options" == "SAMEORIGIN"
Expand All @@ -72,7 +70,6 @@ jsonpath "$.id" matches /\d{4}/ # Check the format of the id

```hurl
GET https://example.org
HTTP 200
[Asserts]
xpath "normalize-space(//head/title)" == "Hello world!"
Expand Down Expand Up @@ -115,7 +112,6 @@ Hurl can also be used to test the <b>performance</b> of HTTP endpoints

```hurl
GET https://example.org/api/v1/pets
HTTP 200
[Asserts]
duration < 1000 # Duration in ms
Expand All @@ -125,7 +121,6 @@ And check response bytes

```hurl
GET https://example.org/data.tar.gz
HTTP 200
[Asserts]
sha256 == hex,039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81;
Expand Down Expand Up @@ -523,7 +518,6 @@ Use implicit response asserts to test header values:

```hurl
GET https://example.org/index.html
HTTP 200
Set-Cookie: theme=light
Set-Cookie: sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT
Expand All @@ -536,7 +530,6 @@ Or use explicit response asserts with [predicates]:

```hurl
GET https://example.org
HTTP 302
[Asserts]
header "Location" contains "www.example.net"
Expand All @@ -552,7 +545,6 @@ Asserting JSON body response (node values, collection count etc...) with [JSONPa
```hurl
GET https://example.org/order
screencapability: low
HTTP 200
[Asserts]
jsonpath "$.validated" == true
Expand All @@ -572,15 +564,13 @@ Testing status code:

```hurl
GET https://example.org/order/435
HTTP 200
```

[Doc](https://hurl.dev/docs/asserting-response.html#version-status)

```hurl
GET https://example.org/order/435
# Testing status code is in a 200-300 range
HTTP *
[Asserts]
Expand All @@ -595,10 +585,8 @@ status < 300

```hurl
GET https://example.org
HTTP 200
Content-Type: text/html; charset=UTF-8
[Asserts]
xpath "string(/html/head/title)" contains "Example" # Check title
xpath "count(//p)" == 2 # Check the number of p
Expand All @@ -614,7 +602,6 @@ xpath "string(//div[1])" matches /Hello.*/

```hurl
GET https://example.org/home
HTTP 200
[Asserts]
cookie "JSESSIONID" == "8400BAFE2F66443613DC38AE3D9D6239"
Expand All @@ -633,7 +620,6 @@ Check the SHA-256 response body hash:

```hurl
GET https://example.org/data.tar.gz
HTTP 200
[Asserts]
sha256 == hex,039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81;
Expand All @@ -647,7 +633,6 @@ Check the properties of a SSL certificate:

```hurl
GET https://example.org
HTTP 200
[Asserts]
certificate "Subject" == "CN=example.org"
Expand Down Expand Up @@ -679,7 +664,6 @@ Retry request on any errors (asserts, captures, status code, runtime etc...):
```hurl
# Create a new job
POST https://api.example.org/jobs
HTTP 201
[Captures]
job_id: jsonpath "$.id"
Expand All @@ -691,7 +675,6 @@ jsonpath "$.state" == "RUNNING"
GET https://api.example.org/jobs/{{job_id}}
[Options]
retry: 10 # maximum number of retry, -1 for unlimited
HTTP 200
[Asserts]
jsonpath "$.state" == "COMPLETED"
Expand All @@ -705,7 +688,6 @@ jsonpath "$.state" == "COMPLETED"

```hurl
GET https://sample.org/helloworld
HTTP *
[Asserts]
duration < 1000 # Check that response time is less than one second
Expand All @@ -728,7 +710,6 @@ SOAPAction: "http://www.w3.org/2003/05/soap-envelope"
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
HTTP 200
```

Expand All @@ -738,7 +719,6 @@ HTTP 200

```hurl
GET https://example.org
HTTP 200
[Captures]
csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)"
Expand All @@ -755,7 +735,6 @@ HTTP 302

```hurl
GET https://example.org/data.bin
HTTP 200
[Asserts]
bytes startsWith hex,efbbbf;
Expand Down Expand Up @@ -954,7 +933,7 @@ will follow a redirection only for the second entry.
| <a href="#interactive" id="interactive"><code>--interactive</code></a> | Stop between requests.<br><br>This is similar to a break point, You can then continue (Press C) or quit (Press Q).<br> |
| <a href="#ipv4" id="ipv4"><code>-4, --ipv4</code></a> | This option tells Hurl to use IPv4 addresses only when resolving host names, and not for example try IPv6.<br> |
| <a href="#ipv6" id="ipv6"><code>-6, --ipv6</code></a> | This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4.<br> |
| <a href="#json" id="json"><code>--json</code></a> | Output each hurl file result to JSON. The format is very closed to HAR format.<br> |
| <a href="#json" id="json"><code>--json</code></a> | Output each Hurl file result to JSON. The format is very closed to HAR format.<br> |
| <a href="#key" id="key"><code>--key &lt;KEY&gt;</code></a> | Private key file name.<br> |
| <a href="#location" id="location"><code>-L, --location</code></a> | Follow redirect. To limit the amount of redirects to follow use the [`--max-redirs`](#max-redirs) option<br> |
| <a href="#location-trusted" id="location-trusted"><code>--location-trusted</code></a> | Like [`-L, --location`](#location), but allows sending the name + password to all hosts that the site may redirect to.<br>This may or may not introduce a security breach if the site redirects you to a site to which you send your authentication info (which is plaintext in the case of HTTP Basic authentication).<br> |
Expand Down
Loading

0 comments on commit 7bfae0a

Please sign in to comment.