pondbay

微信公众平台开发 第三方接口
作者:方倍工作室 
地址:http://www.cnblogs.com/txw1958/p/weixin72-third-party-api.html

 

测试代码

<?php
/*
    方倍工作室 第三方接口 测试代码
*/

$post = "<xml><ToUserName><![CDATA[gh_204936aea56d]]></ToUserName>
<FromUserName><![CDATA[oc7tbuPEJdWm7jLJqRPCDNoWq480]]></FromUserName>
<CreateTime>1383811836</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[深圳天气]]></Content>
<MsgId>5943426579437733541</MsgId>
</xml>";

$url = "http://www.abc.com/weixin/";
$headers = array("Content-Type: text/xml; charset=utf-8");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$output = curl_exec($ch);
curl_close($ch);
echo $output;

?>

 

分类:

技术点:

相关文章:

  • 2021-10-03
  • 2022-12-23
  • 2021-06-26
  • 2022-02-11
  • 2021-11-30
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2021-11-30
  • 2021-11-29
  • 2021-07-28
  • 2021-09-05
  • 2022-01-01
  • 2021-12-08
  • 2021-06-11
相关资源
相似解决方案