发送POST请求在request中有以次data内容
程序员文章站
2022-05-29 17:02:00
...
发送POST请求在request中有以下data内容
接口实例:
http://199.199.99.199:8080/cloudTVPlatform/external/api?act=notifyNewDeveloper&PID=CloudTVDN&pversion=1.0&format=JSON
请求方式:POST
请求URL参数说明:
act:操作类型,notifyNewDeveloper,必须
pversion:协议版本,默认为1.0
PID:合作伙伴代码PID,填写CloudTVDN,必须
format:返回的数据格式,支持XML和JSON,默认为JSON
通知数据(POST DATA)实例
POST请求在request中获取参数data内容如下
{
" developerCount ": 2,
"data": [
{
"originalID": "123",
"developerName": "liux",
"developerType": "个人",
"trueName": "刘",
"eMail": "[email protected]",
"phone": "86-10-62565615-208",
"mobile": "86-13900000000",
"fax": "86-10-62565615-208",
"ECURL": "http://DNS/123.JPG",
"CRURL": "",
"CTURL": "",
"registerTime": "2014-04-02 14:14:19"
},
{
"originalID": "124",
"developerName": "liux1",
"developerType": "公司",
"trueName": "百度",
"eMail": "[email protected]",
"phone": "86-10-62565615-208",
"mobile": "86-13900000000",
"fax": "86-10-62565615-208",
"ECURL": "http://DNS/124.JPG",
"CRURL": " http://DNS/125.JPG ",
"CTURL": " http://DNS/126.JPG ",
"registerTime ": "2014-04-02 14:14:19"
}
]
}
返回数据:
返回数据格式:JSON
返回实例:
{
"resultCode": "Success",
"resultMessage": "成功处理"
}
那是客户端提供的接口,而我在服务器端我调用这接口,然后用POST传给他data内容,这应该怎么做啊?我是新手~~~
------解决方案--------------------
$data = json_encode(array(你要发送的data数组));
$rs = curl_post("http://199.199.99.199:8080/cloudTVPlatform/external/api?act=notifyNewDeveloper&PID=CloudTVDN&pversion=1.0&format=JSON", $data);
接口实例:
http://199.199.99.199:8080/cloudTVPlatform/external/api?act=notifyNewDeveloper&PID=CloudTVDN&pversion=1.0&format=JSON
请求方式:POST
请求URL参数说明:
act:操作类型,notifyNewDeveloper,必须
pversion:协议版本,默认为1.0
PID:合作伙伴代码PID,填写CloudTVDN,必须
format:返回的数据格式,支持XML和JSON,默认为JSON
通知数据(POST DATA)实例
POST请求在request中获取参数data内容如下
{
" developerCount ": 2,
"data": [
{
"originalID": "123",
"developerName": "liux",
"developerType": "个人",
"trueName": "刘",
"eMail": "[email protected]",
"phone": "86-10-62565615-208",
"mobile": "86-13900000000",
"fax": "86-10-62565615-208",
"ECURL": "http://DNS/123.JPG",
"CRURL": "",
"CTURL": "",
"registerTime": "2014-04-02 14:14:19"
},
{
"originalID": "124",
"developerName": "liux1",
"developerType": "公司",
"trueName": "百度",
"eMail": "[email protected]",
"phone": "86-10-62565615-208",
"mobile": "86-13900000000",
"fax": "86-10-62565615-208",
"ECURL": "http://DNS/124.JPG",
"CRURL": " http://DNS/125.JPG ",
"CTURL": " http://DNS/126.JPG ",
"registerTime ": "2014-04-02 14:14:19"
}
]
}
返回数据:
返回数据格式:JSON
返回实例:
{
"resultCode": "Success",
"resultMessage": "成功处理"
}
那是客户端提供的接口,而我在服务器端我调用这接口,然后用POST传给他data内容,这应该怎么做啊?我是新手~~~
------解决方案--------------------
$data = json_encode(array(你要发送的data数组));
$rs = curl_post("http://199.199.99.199:8080/cloudTVPlatform/external/api?act=notifyNewDeveloper&PID=CloudTVDN&pversion=1.0&format=JSON", $data);
相关文章
相关视频
上一篇: JavaScript中变量的存储方式