duanjiu6697 2014-09-24 12:06
浏览 112

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

I am newbie with Social Minor I am trying to create a new Feed in Social Miner using "Social-Miner Create Feed API".

Problem:

When I click on "Create Feed" button on my interface I receive following error: " type Invalid 16-bit integer. invalid Input.format.short "

Code:

     <?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);
    }

?>

Need Help?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比