Send POST request with secondary data content in Request

Source: Internet
Author: User
The Send POST request has the following data content in request
Interface instance:
http://199.199.99.199:8080/cloudTVPlatform/external/api?act=notifyNewDeveloper&PID=CloudTVDN&pversion= 1.0&format=json
Request Method: POST
Request URL Parameter Description:
Act: Type of operation, Notifynewdeveloper, must
Pversion: protocol version, default = 1.0
PID: Partner Code PID, fill in Cloudtvdn, must
Format: Data formats returned, XML and JSON supported, JSON by default
Notification data (POST data) instance
The POST request takes the parameter data content in request in the following
{
"Developercount": 2,
"Data": [
{
"Originalid": "123",
"Developername": "Liux",
"Developertype": "Personal",
"Truename": "Liu",
"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": "Company",
"Truename": "Baidu",
"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"
}
]
}

Return Data:
Return Data format: JSON
To return an instance:
{
"ResultCode": "Success",
"Resultmessage": "Successful Processing"
}
That is the interface provided by the client, and I am on the server side I call this interface, and then use post to his data content, this should do? I am a novice ~ ~ ~
------Solution--------------------
References:
Quote: References:

PHP uses the curl extension to simulate post submissions. Reference Code




























}
And then how to invoke it?

$data = Json_encode (Array (the data array you want to send));
$rs = Curl_post ("http://199.199.99.199:8080/cloudTVPlatform/external/api?act=notifyNewDeveloper&PID= Cloudtvdn&pversion=1.0&format=json ", $data);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.