如何解决Python / Javascript中的Api密钥请求
我正在尝试向API发出请求。我已经有了API密钥并阅读了文档。
文档:https://info.nobil.no/images/downloads/API-NOBIL-Documentation_v3_20180808.pdf
在我看来,文档中的示例使用的是javascript。
jQuery.ajax({
type: 'POST',url: 'https://nobil.no/api/server/search.php',data: { 'apikey': nobilApiKey,'apiversion': '3','action': "search",'type': 'rectangle','northeast': '(59.943921193288915,10.826683044433594)','southwest': '(59.883683240905256,10.650901794433594)','existingids': '189,195,199,89,48'},dataType: 'json'
});
问题: 1.)我可以使用python向服务器发出请求吗? 2.)如何将api密钥合并到代码中?
非常感谢展示如何的代码段!
解决方法
您将使用onFileChange(e) {
var files = e.target.files || e.dataTransfer.files;
if (!files.length) return;
this.file = files[0]
this.createImage(this.file);
},
库
它看起来像这样:
requests
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。