Php 我想发送“am”;http 200";使用卷曲
我正在回复Paypal IPN系统 我想发封信 “HTTP/1.1 200正常” 在发送带有数据的Php 我想发送“am”;http 200";使用卷曲,php,http,curl,Php,Http,Curl,我正在回复Paypal IPN系统 我想发封信 “HTTP/1.1 200正常” 在发送带有数据的php curl之前 我想我也应该在php curl中这样做(而不是标题(“HTTP/1.1200 OK”);) 有人能给我提供代码吗?还是页眉可以 function curl() { $ch = curl_init(); $data = array( "Content-type: , "POST /your api curl method
php curl
之前
我想我也应该在php curl
中这样做(而不是标题(“HTTP/1.1200 OK”);
)
有人能给我提供代码吗?还是页眉可以
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;
}
应在标题中发送它是一个响应状态代码。在发送请求时,您认为应该(或可以)发送它的原因是什么?curl_setopt($ch,CURLOPT_CUSTOMREQUEST,“HTTP/1.1200 OK”);为什么发送POST请求会导致包含响应头?此外,您缺少一个报价。请注意提供准确答案并加以解释。