阿里云
1024开发者盛宴之Java专家问答专场
发表主题 回复主题
  • 288阅读
  • 0回复

[技术交流]自建表插入数据报错“请求被禁止”

级别: 小白
发帖
19
云币
25
// https://github.com/aliyun/iotx-api-gateway-client public static void main(String[] args) throws UnsupportedEncodingException {SyncApiClient syncClient = SyncApiClient.newBuilder().appKey("你的<AppKey>").appSecret("你的<AppSecret>").build();IoTApiRequest request = new IoTApiRequest();//设置api的版本request.setApiVer("1.1.0");// 接口参数request.putParam("dataInsertJson","value1");request.putParam("userContextDTO","value2");//请求参数域名、path、requestApiResponse response = syncClient.postBody("api.link.aliyun.com","/datacenter/data/insert", request, true);System.out.println("response code = " + response.getStatusCode() + " response content = " + new String(response.getBody(),"utf-8"));}
官方的API的示例是{"cols":["city_name","temperature","dim_time"],"data":[["北京","10.1","2017-10-17 15:35:00"],["上海","15.1","2017-10-17 16:35:00"],["杭州","16.1","2017-10-18 00:00:00"]],"mid":405}[font=Helvetica, 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 'PingFang SC']
不知道mid:405是什么意思
[font=Helvetica, 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 'PingFang SC']
还有就是建表的表名是接口的那个参数
[ 此帖被hongkaijia在2018-07-30 21:58重新编辑 ]
发表主题 回复主题
« 返回列表上一主题下一主题

限100 字节
批量上传需要先选择文件,再选择上传
 
验证问题: ECS是阿里云提供的什么服务? 正确答案:云服务器
上一个 下一个