【问题标题】:How to send multiple values in rest url in java如何在java中的rest url中发送多个值
【发布时间】:2021-12-02 08:14:44
【问题描述】:

我有一个如下所示的获取请求。

https://localhost.com:8080/search?date=2021110

我在发出 get 请求时得到结果。但我的要求是获得具有 2 个状态的多个值。像 status=2 和 status=3 如果我像这样修改我的网址

https://localhost.com:8080/search?status=2&status=3&date=2021110

【问题讨论】:

  • 您不能将相同的query string 放在url 中,因为它会产生歧义

标签: java rest get restful-url


【解决方案1】:

为什么不将请求方法更改为 POST。或者你也可以在两个值之间使用','并在服务器编程中处理它。

【讨论】:

    猜你喜欢
    • 2016-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-19
    • 1970-01-01
    • 2010-10-20
    相关资源
    最近更新 更多