首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我想用curl发送am "http 200“

我想用curl发送am "http 200“
EN

Stack Overflow用户
提问于 2016-12-14 11:55:15
回答 1查看 491关注 0票数 0

我正在对Paypal IPN系统做出响应

我想送一份

"HTTP/1.1 200 OK“

在我发送带有数据的php curl之前

我想我也应该用php curl (而不是header("HTTP/1.1 200 OK"); )来做这个。

有人能给我提供密码吗?还是标题没问题?

EN

回答 1

Stack Overflow用户

发布于 2016-12-14 12:00:45

代码语言:javascript
运行
复制
 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;
    }

应该在标头中发送

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41142013

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档