我正在对Paypal IPN系统做出回应
我想发送一个
" HTTP / 1.1 200 OK"
在发送带有数据的php curl
之前
我想我也应该在php curl
中做到这一点(而不是header("HTTP/1.1 200 OK");
)
任何人都可以为我提供代码吗?或标题好吗?
答案 0 :(得分:-1)
function curl()
{
$ch = curl_init();
$data = array(
"Content-type: ,
"POST /your api curl method HTTP/1.1",
"Accept: ",
"Host: "host url",
"Content-length: your param length
);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_URL, post url here);
curl_setopt($ch, CURLOPT_HTTPHEADER, $data);
curl_setopt($ch, CURLOPT_POSTFIELDS, post param here );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
return $output;
}
应该在标题
中发送