diff --git a/CHANGELOG.md b/CHANGELOG.md index fbcc3b6..991756a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] - ✨ — Allow to customize agent User-Agent header (#78) +- 📝 — Document how to add data to requests (#77) ## 0.7.4 diff --git a/docs/checks.md b/docs/checks.md index 8e961e2..82ee77e 100644 --- a/docs/checks.md +++ b/docs/checks.md @@ -82,6 +82,48 @@ caption: argos-config.yaml - json-is: '{"foo": "bar", "baz": 42}' ``` +## Add data to requests + +If you want to specify query parameters, just put them in the path: + +```{code-block} yaml +websites: + - domain: "https://contact.example.org" + paths: + - path: "/index.php?action=show_messages" + method: "GET" +``` + +If you want, for example, to test a form and send some data to it: + +```{code-block} yaml +websites: + - domain: "https://contact.example.org" + paths: + - path: "/" + method: "POST" + request_data: + # These are the data sent to the server: title and msg + data: + title: "Hello my friend" + msg: "How are you today?" + # To send data as JSON (optional, default is false): + is_json: true +``` + +If you need to send some headers in the request: + +```{code-block} yaml +websites: + - domain: "https://contact.example.org" + paths: + - path: "/api/mail" + method: "PUT" + request_data: + headers: + Authorization: "Bearer foo-bar-baz" +``` + ## SSL certificate expiration Checks that the SSL certificate will not expire soon. You need to define the thresholds in the configuration, and set the `on-check` option to enable the check. diff --git a/docs/cli.md b/docs/cli.md index a9aac5e..e524a8c 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -61,6 +61,8 @@ Options: --wait-time INTEGER Waiting time between two polls on the server (seconds) --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] + --user-agent TEXT A custom string to append to the User-Agent + header --help Show this message and exit. ```