summaryrefslogtreecommitdiff
path: root/classes/curl.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-26 08:48:08 +0300
committerValentin Popov <info@valentineus.link>2017-10-26 08:48:08 +0300
commit5179a7ec051a7a7709efecbf7622693f3c40416b (patch)
tree7538234d06d517c9520737a7591f88f6f4207c61 /classes/curl.php
parent18a5d23d07628ba63d4256e02fb71a8fd7bad7bb (diff)
downloadlocal_webhooks-5179a7ec051a7a7709efecbf7622693f3c40416b.tar.xz
local_webhooks-5179a7ec051a7a7709efecbf7622693f3c40416b.zip
Header type processing
Diffstat (limited to 'classes/curl.php')
-rw-r--r--classes/curl.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/classes/curl.php b/classes/curl.php
index b96367d..355b13c 100644
--- a/classes/curl.php
+++ b/classes/curl.php
@@ -33,14 +33,14 @@ class curl {
}
}
- public static function request($url, $data) {
- $ch = curl_init($url);
+ public static function request($callback, $data) {
+ $ch = curl_init($callback->url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
- "Content-Type: application/json",
+ "Content-Type: application/" . $callback->type,
"Content-Length: " . strlen($data))
);