"输入无效的16位整数。无效的Input.format.short"使用CURL的HTTP POST请求时出错

时间:2014-09-24 12:06:51

标签: php post curl format

我是Social Minor的新手我正在尝试使用" Social-Miner Create Feed API"创建一个新的社交矿工Feed。

问题

当我点击"创建Feed"我的界面上的按钮我收到以下错误:" type无效的16位整数。 Input.format.short"

无效

代码:

     <?php
        error_reporting(o);

        $URL = "http://192.168.200.163:8080/ccp-webapp/ccp/feed";

        //Create Feed form values
        $type = $_POST['type'];
        $feed_name = $_POST['feed_name'];
        $description = $_POST['description'];
        $ur = $_POST['ur'];
        $polling_interval = $_POST['polling_interval'];
        $minimum_age = $_POST['minimum_age'];
        $reply_template = $_POST['reply_template'];
        $tags = $_POST['tags'];

        //Storing above values in a string
        $myFeedString='<?xml version="1.0" encoding="utf-8"?>
        <Feed>
        <type>$type</type>
        <name>$feed_name</name>
        <description>$description</description>
        <ur>$ur</ur>
        <polling_interval>$polling_interval</polling_interval>
        <minimum_age>$minimum_age</minimum_age>
        <tags>
        <tag>$tags</tag>
        </tags>
        </Feed>
        ';

            //setting the curl parameters.
            $ch = curl_init();

            curl_setopt($ch, CURLOPT_URL,$URL);
            curl_setopt($ch, CURLOPT_USERPWD, "hashmatkhan" . ":" . "Army2life");
            curl_setopt($ch, CURLOPT_VERBOSE, 1);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
            curl_setopt($ch, CURLOPT_POSTFIELDS, $myFeedString);



        if (curl_errno($ch)) 
    {
        //moving to display page to display curl errors
          echo curl_errno($ch) ;
          echo curl_error($ch);
    } 
    else 
    {
        //getting response from server
        $response = curl_exec($ch);
         print_r($response);
         curl_close($ch);
    }

?>

需要帮助?

0 个答案:

没有答案