From 5179a7ec051a7a7709efecbf7622693f3c40416b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Oct 2017 09:48:08 +0400 Subject: Header type processing --- classes/curl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'classes/curl.php') 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)) ); -- cgit v1.2.3