$value) { curl_setopt($ch, CURLOPT_HTTPHEADER, ["$header: $value"]); } // Handle POST data if it exists if ($_SERVER['REQUEST_METHOD'] === 'POST') { curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents('php://input')); } // Execute the request $response = curl_exec($ch); // Forward the response back to the client http_response_code(curl_getinfo($ch, CURLINFO_HTTP_CODE)); echo $response; // Close cURL curl_close($ch);