Translations:S2S ping/19/en

From Wiki Kaminari Click
Revision as of 02:11, 19 September 2023 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );

   curl_setopt( $ch, CURLOPT_HTTPHEADER, [
       'Content-Type:application/json',
       'Accept-Language:' . $_SERVER['HTTP_ACCEPT_LANGUAGE'],
       'User-Agent:' . $_SERVER['HTTP_USER_AGENT'],
       'DPR:2',
       isset($_SERVER['HTTP_REFERER']) ? 'Referer:' . $_SERVER['HTTP_REFERER'] : 'Referer:""',
   ]);
   curl_setopt( $ch, CURLOPT_HEADER, true);
   curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
   
   $response = curl_exec($ch);
   $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
   $header = substr($response, 0, $header_size);
   $body = substr($response, $header_size);
   $body = str_replace('", "', '",
"', $body); $body = str_replace('{ "', '{
"', $body); echo "<pre>1. Response length: $header_size</pre>"; echo "<pre>2. Response body: $body</pre>";