我正在尝试向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密钥输入到代码中
如果你能给我一个代码片段来说明你是如何做到的,我将不胜感激
您将使用
requests
库它看起来像这样:
请阅读此处的文档:https://requests.readthedocs.io/en/master/
相关问题 更多 >
编程相关推荐