mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 09:52:38 +02:00
📝 — Document how to add data to requests (fix #77)
This commit is contained in:
parent
db54dd2cdd
commit
73e7a8f414
3 changed files with 45 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue