Kern -PHP Curl - Header Origin Pass Null -Wert
Posted: 30 Apr 2025, 20:40
Zahlungsgateway -Integration Um auf die URL zugreifen zu können, verwende ich die Curl -Funktion von PHP. < /p>
Die Code -Antwort ist 200 OK. Es ist jedoch nicht die beabsichtigte Antwort. Ich habe die Anforderungsheader im Entwickler -Tool überprüft und festgestellt, dass der Ursprungswert null ist.
Die Code -Antwort ist 200 OK. Es ist jedoch nicht die beabsichtigte Antwort. Ich habe die Anforderungsheader im Entwickler -Tool überprüft und festgestellt, dass der Ursprungswert null ist.
Code: Select all
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://test.sbiepay.sbi/secure/AggregatorHostedListener");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'EncryptTrans' => $EncryptTrans,
'merchIdVal' => $sbimerchantid
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Origin: https://daa12.in',
'Referer: https://daa12.in/',
'Content-Type: application/x-www-form-urlencoded',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
if ($response === false) {
echo "cURL Error: " . curl_error($ch);
}
else
{
echo $response;
}
curl_close($ch);
< /code>
Wie beheben Sie dieses Problem? Wenn die richtige URL von der Ursprungsvariablen [url=viewtopic.php?t=23709]übergeben[/url] wird, werde ich die erwartete Antwort erhalten. Ich weiß nicht; Der Ursprungswert ist null.accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-encoding: gzip, deflate, br, zstd
accept-language: en-US,en;q=0.9,ar;q=0.8
cache-control: max-age=0
connection: keep-alive
content-length: 318
content-type: application/x-www-form-urlencoded
cookie: PHPSESSID=07s6sja3dqlllmrl9n82kq46ob
host: daa12.in
origin: null