Token-based authentication for secure API access
POST /api-endpoint-url Headers: X-API-Token: your_token_here Body (form-data): raw_cookie: NetflixId=xxx; SecureNetflixId=yyy ajax: 1
<?php
$url = 'https://website.com/api-endpoint-url';
$token = 'YOUR_TOKEN_HERE';
$data = [
'raw_cookie' => 'NetflixId=xxx; SecureNetflixId=yyy',
'ajax' => 1
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Token: ' . $token
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
?>
import requests
url = "https://website.com/api-endpoint-url"
token = "YOUR_TOKEN_HERE"
data = {
"raw_cookie": "NetflixId=xxx; SecureNetflixId=yyy",
"ajax": 1
}
headers = {
"X-API-Token": token
}
response = requests.post(url, data=data, headers=headers)
print(response.json())
const token = 'YOUR_TOKEN_HERE';
const formData = new FormData();
formData.append('raw_cookie', 'NetflixId=xxx; SecureNetflixId=yyy');
formData.append('ajax', '1');
fetch('https://website.com/api-endpoint-url', {
method: 'POST',
headers: {
'X-API-Token': token
},
body: formData
})
.then(response => response.json())
.then(result => console.log(result));