From b7e442b8ca932941192be34830143c93fa0e88fa Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Wed, 26 Oct 2016 16:42:01 -0400 Subject: [PATCH] Use a JSON POST body rather than a form POST param in route --- README.md | 4 ++-- server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9bda4c0..4801a5b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/server.py b/server.py index b3fd757..e50ac1f 100755 --- a/server.py +++ b/server.py @@ -22,7 +22,7 @@ def fetch_view(): """ Fetch from weboob modules. """ - params = request.forms.get("params") + params = request.body.read() return cozyweboob(params)