Skip to content

Commit

Permalink
update file_get_contents to work with http
Browse files Browse the repository at this point in the history
  • Loading branch information
saravahdatipour committed Nov 18, 2024
1 parent 07d702b commit 7a33642
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions start_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
];

function start_session($type) {
global $sprequests, $protocol;
global $sprequests;

if (array_key_exists($type, $sprequests))
$sessionrequest = $sprequests[$type];
Expand All @@ -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,
)
);

Expand Down

0 comments on commit 7a33642

Please sign in to comment.