Use a JSON POST body rather than a form POST param in route

This commit is contained in:
Lucas Verney 2016-10-26 16:42:01 -04:00
parent c793e56769
commit b7e442b8ca
2 changed files with 3 additions and 3 deletions

View File

@ -36,11 +36,11 @@ default).
It exposes a couple of routes:
* the `/fetch` route, which supports `POST` method to send a valid JSON string
defining konnectors to be used in a `params` field. Typical example to send
defining konnectors to be used as the request body. Typical example to send
it some content is:
```bash
curl -X POST --data "params=$(cat konnectors.json)" "http://localhost:8080/"
curl -X POST --data "$(cat konnectors.json)" "http://localhost:8080/"
```
where `konnectors.json` is a valid JSON file defining konnectors to be used.
Downloaded files will be stored in a temporary directory, and their file URI

View File

@ -22,7 +22,7 @@ def fetch_view():
"""
Fetch from weboob modules.
"""
params = request.forms.get("params")
params = request.body.read()
return cozyweboob(params)