summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2016-05-25 18:18:11 +0200
committerChristian Schneider2016-05-25 18:18:11 +0200
commitcf9871809d88018a49775ea59d1ec58cf2fd4eb5 (patch)
tree058e978feaa41a9adbc64e8d1b50bb9bb926e928
parent89a2fe5ba2dfbac07495fd1edbd1fb7e6fff1950 (diff)
downloaditools-cf9871809d88018a49775ea59d1ec58cf2fd4eb5.tar.gz
itools-cf9871809d88018a49775ea59d1ec58cf2fd4eb5.tar.bz2
itools-cf9871809d88018a49775ea59d1ec58cf2fd4eb5.zip
Support method and data parameter in curl code path as well (used for https)
-rw-r--r--it_url.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class
index 33ceb7b..52a72d0 100644
--- a/it_url.class
+++ b/it_url.class
@@ -284,6 +284,9 @@ static function curl_opts($p=array())
);
}
+ if ($p['data'])
+ $add[CURLOPT_POSTFIELDS] = $p['data'];
+
return (array)$add + array(
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
@@ -292,6 +295,7 @@ static function curl_opts($p=array())
CURLOPT_LOW_SPEED_TIME => $p['timeout'],
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTPHEADER => $headers,
+ CURLOPT_CUSTOMREQUEST => $p['method'] ?: null,
CURLOPT_CAPATH => '/etc/ssl/certs/',
CURLOPT_SSL_VERIFYPEER => !$p['allow_insecure_ssl'],