简体   繁体   English

如何在API的url参数上使用通配符?

[英]How can I use a wildcard on a url parameter to an API?

I'm using the Dutch 9292 API (which is only unofficially documented), it is the official public transportation API. 我使用的是Dutch 9292 API(仅非正式记录),它是官方的公共交通API。 In Postman I make a GET request to api.9292.nl/0.1/locations?lang=nl-NL& q=a &type=station , but I'd like to get a list of all stations. 在Postman中,我向api.9292.nl/0.1/locations?lang=nl-NL& q = a &type = station发出GET请求,但我想获取所有站点的列表。 Not just the ones starting with "a". 不只是那些以“ a”开头的。 I know I can loop trough the alphabet, but that would require 26 calls and I hope it can be done in 1. The site returns JSON. 我知道我可以循环遍历字母表,但是这需要26次调用,我希望可以在1次中完成。该站点返回JSON。

What happens if you omit the "q" query parameter ? 如果省略“ q”查询参数会怎样? ( api.9292.nl/0.1/locations?lang=nl-NL&q=a&type=station ) api.9292.nl/0.1/locations?lang=nl-NL&q=a&type=station

If the REST API is well designed this should give you what you expect. 如果REST API设计合理,则应该可以为您带来期望。

Pretty difficult to answer without the API doc. 没有API文档,很难回答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM