Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
蔚蓝“;“简易桌”;RESTAPI主体_Api_Rest_Azure - Fatal编程技术网

蔚蓝“;“简易桌”;RESTAPI主体

蔚蓝“;“简易桌”;RESTAPI主体,api,rest,azure,Api,Rest,Azure,我目前正在试用Azure的新“简易表”。我已经读到它是完全RESTful的,我完全能够“获取”表中的数据,但不知何故,我不确定如何插入我尝试使用“POST”的数据,但无论我在curl请求的“数据”部分中输入了什么,它总是说 {"error":"An item to insert was not provided"} 有人能告诉我身体应该是什么样子吗?我真的很绝望 我的桌子看起来像这样: id | createdAt | updatedAt | version | deleted | orgID

我目前正在试用Azure的新“简易表”。我已经读到它是完全RESTful的,我完全能够“获取”表中的数据,但不知何故,我不确定如何插入我尝试使用“POST”的数据,但无论我在curl请求的“数据”部分中输入了什么,它总是说

{"error":"An item to insert was not provided"}
有人能告诉我身体应该是什么样子吗?我真的很绝望

我的桌子看起来像这样:

id | createdAt | updatedAt | version | deleted | orgID
请注意,只有orgID是我插入的列


提前谢谢

下面是使用curl时请求的情况:

curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
    "id" :"1111",
    "orgID" : "1234"
}' "http://<your_site_host>/tables/<tablename>?zumo-api-version=2.0.0"
curl-X POST-H“内容类型:应用程序/json”-H“缓存控制:无缓存”-d”{
“id”:“1111”,
“orgID”:“1234”
}' "http:///tables/?zumo-api版本=2.0.0“
希望能有所帮助。

$urlAzure=”https://.azurewebsites.net/tables/";
$urlAzure = "https://<your_app>.azurewebsites.net/tables/<your_table>";
$data = array (
  '<column1>' => <some_text>,
  '<column2>' => <some_text>
);
$options = array(
    'http' => array(
      'method'  => 'POST',
      'content' => json_encode( $data ),
      'header'=>  "Content-Type: application/json\r\n" .
                "Accept: application/json\r\n"
    )
);
$context  = stream_context_create($options);
$result= file_get_contents($urlAzure, false, $context);
if ($result === FALSE) { /* Handle error */ }
$data=数组( '' => , '' => ); $options=array( “http'=>数组( '方法'=>'发布', 'content'=>json_encode($data), 'header'=>“内容类型:application/json\r\n”。 “接受:应用程序/json\r\n” ) ); $context=stream\u context\u create($options); $result=file\u get\u contents($urlAzure,false,$context); 如果($result==FALSE){/*句柄错误*/}
您在哪个平台工作?每个应用程序(Mobiel、Web、API)都包含一个SDK,可以让您的开发生活更快乐:)您是否有一个“获取”示例?我只能获取所有记录,但我想查询特定字段