error-pages/test/hurl/readme.md
2022-01-27 17:29:49 +05:00

660 B

Hurl

Hurl is a command line tool that runs HTTP requests defined in a simple plain text format.

How to use

It can perform requests, capture values and evaluate queries on headers and body response. Hurl is very versatile: it can be used for both fetching data and testing HTTP sessions.

# Get home:
GET https://example.net

HTTP/1.1 200
[Captures]
csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)"

# Do login!
POST https://example.net/login?user=toto&password=1234
X-CSRF-TOKEN: {{csrf_token}}

HTTP/1.1 302