From 7faf53d71f391d1ba84bdef49df92e28b5e4120d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 27 Jun 2017 13:40:15 +0300 Subject: [PATCH] Updated curl example for pausing a check. --- templates/front/docs_api.html | 6 ++++++ templates/front/snippets/pause_check_request.html | 2 +- templates/front/snippets/pause_check_request.txt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/front/docs_api.html b/templates/front/docs_api.html index f29a987a..439a967d 100644 --- a/templates/front/docs_api.html +++ b/templates/front/docs_api.html @@ -336,6 +336,12 @@ To create a "cron" check, specify the "schedule" and "tz" parameters. {% include "front/snippets/pause_check_request.html" %} +

Note: the --data "" argument forces curl to send a +Content-Length request header even though the request body +is empty. For HTTP POST requests, the Content-Length header +is sometimes required by some network proxies and web servers. +

+

Example Response

{% include "front/snippets/pause_check_response.html" %} diff --git a/templates/front/snippets/pause_check_request.html b/templates/front/snippets/pause_check_request.html index 53fff4e7..2b47ea13 100644 --- a/templates/front/snippets/pause_check_request.html +++ b/templates/front/snippets/pause_check_request.html @@ -1,3 +1,3 @@
curl {{ SITE_ROOT }}/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause \
-    --request POST --header "X-Api-Key: your-api-key"
+    --request POST --header "X-Api-Key: your-api-key" --data ""
 
diff --git a/templates/front/snippets/pause_check_request.txt b/templates/front/snippets/pause_check_request.txt index 06bcdd9e..c01eaff3 100644 --- a/templates/front/snippets/pause_check_request.txt +++ b/templates/front/snippets/pause_check_request.txt @@ -1,2 +1,2 @@ curl SITE_ROOT/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause \ - --request POST --header "X-Api-Key: your-api-key" + --request POST --header "X-Api-Key: your-api-key" --data ""