Java 使用融合表API的授权拒绝
我的代码:Java 使用融合表API的授权拒绝,java,google-fusion-tables,Java,Google Fusion Tables,我的代码: public class restletexample { String URI = "https://www.googleapis.com/upload/fusiontables/v1/tables/tableid/import"; HashMap<String, String> urlVariables = new HashMap<String, String>(); String column = "'Moth', '30'
public class restletexample {
String URI = "https://www.googleapis.com/upload/fusiontables/v1/tables/tableid/import";
HashMap<String, String> urlVariables = new HashMap<String, String>();
String column = "'Moth', '30', '2012','efef','efefef'";
public void testrestlet() {
urlVariables.put("key=", "KEY");
RestTemplate restTemplate = new RestTemplate();
restTemplate.postForLocation(URI, column, urlVariables);
}
public static void main(String args[]) {
restletexample rst = new restletexample();
rst.testrestlet();
}
}
我已经在API控制台中生成了密钥,并且正在使用相同的密钥。我不知道谷歌为什么不批准我的请求。需要帮助…从过去4个小时以来,我的头都碎了。你的URI似乎错了-“tableid”应该替换为你表格的实际ID 我不想公开我的tableid,这就是我为什么不写它的原因。
Exception in thread "main" org.springframework.web.client.HttpClientErrorException: 401 Unauthorized