📝 — Document how to add data to requests (fix #77)

This commit is contained in:
Luc Didry 2025-02-12 16:25:10 +01:00
parent db54dd2cdd
commit 73e7a8f414
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C
3 changed files with 45 additions and 0 deletions

View file

@ -3,6 +3,7 @@
## [Unreleased] ## [Unreleased]
- ✨ — Allow to customize agent User-Agent header (#78) - ✨ — Allow to customize agent User-Agent header (#78)
- 📝 — Document how to add data to requests (#77)
## 0.7.4 ## 0.7.4

View file

@ -82,6 +82,48 @@ caption: argos-config.yaml
- json-is: '{"foo": "bar", "baz": 42}' - 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 ## 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. 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.

View file

@ -61,6 +61,8 @@ Options:
--wait-time INTEGER Waiting time between two polls on the server --wait-time INTEGER Waiting time between two polls on the server
(seconds) (seconds)
--log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] --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. --help Show this message and exit.
``` ```