From 7a3364266bd746fc51a81f6af688760fabb942a5 Mon Sep 17 00:00:00 2001 From: saravahdatipour Date: Mon, 18 Nov 2024 11:25:22 +0100 Subject: [PATCH] update file_get_contents to work with http --- start_session.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/start_session.php b/start_session.php index 83c8c41..c288531 100644 --- a/start_session.php +++ b/start_session.php @@ -44,7 +44,7 @@ ]; function start_session($type) { - global $sprequests, $protocol; + global $sprequests; if (array_key_exists($type, $sprequests)) $sessionrequest = $sprequests[$type]; @@ -54,12 +54,12 @@ function start_session($type) { $jsonsr = json_encode($sessionrequest); $api_call = array( - $protocol => array( + 'http' => array( 'method' => 'POST', 'header' => "Content-type: application/json\r\n" - . "Content-Length: " . strlen($jsonsr) . "\r\n" - . (!empty(API_TOKEN) ? "Authorization: " . API_TOKEN . "\r\n" : ""), - 'content' => $jsonsr + . "Content-Length: " . strlen($jsonsr) . "\r\n" + . "Authorization: " . API_TOKEN . "\r\n", + 'content' => $jsonsr, ) );