I wanted to check if we can use getparam to parse start_time and end_time from the below request URL
https://[--hostname--]/sample_app/apthroughput/getAllControllers?start_time=<start time value>&end_time=<end time value>&label=<selected label>
Run Code Online (Sandbox Code Playgroud)
查询字符串的解析非常简单,除非同一个查询参数有多个值。
e.g.: https://[--hostname--]/sample_app/apthroughput/getAllControllers?type=xxx&type=yyy
Run Code Online (Sandbox Code Playgroud)
在这种情况下,下面的代码有助于获取一种类型的所有参数 List<String>
这个答案给出了一个想法。从它复制:
HttpServerRequest request = RoutingContext.request();
MultiMap params = request.params();
List<String> param = params.getAll("personId");
Here you can get list of personId. URI be like
localhost:8081/myApi?personId=1&personId=2&personId=3
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10276 次 |
| 最近记录: |