aboutsummaryrefslogtreecommitdiff
path: root/libbutl
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl')
-rw-r--r--libbutl/curl.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/libbutl/curl.cxx b/libbutl/curl.cxx
index 7efd28d..5649965 100644
--- a/libbutl/curl.cxx
+++ b/libbutl/curl.cxx
@@ -21,9 +21,20 @@ namespace butl
{
case ftp_put:
throw invalid_argument ("no input specified for PUT method");
+ case http_post:
+ {
+ // Post the empty data.
+ //
+ // Note that while it's tempting to specify the --request POST option
+ // instead, that can potentially overwrite the request methods for the
+ // HTTP 30X response code redirects.
+ //
+ d.options.push_back ("--data-raw");
+ d.options.push_back ("");
+ }
+ // Fall through.
case ftp_get:
case http_get:
- case http_post:
{
d.pipe.in = fdopen_null (); // /dev/null
return pipe (d.pipe);