我正在尝试集成银行API以进行重定向支付。 我使用curl post方法,但我想能够在post后跟随重定向。 这是我的代码
curl_setopt($ch, CURLOPT_URL, 'https://paycenter.piraeusbank.gr/redirection/pay.aspx');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'data' => $data
));
$content = curl_exec($ch);
在发布后,我应该被重定向到一个类似于以下的URL:
https://paycenter.piraeusbank.gr/redirection/4234sgsfdgfsg/pay.aspx
我将重定向到以下页面:
http://mytestdomain.org/redirection/4234sgsfdgfsg/pay.aspx
很明显,这会导致404错误。