【问题标题】:Do a get request passing a bar as parameter in the url做一个获取请求,在 url 中传递一个 bar 作为参数
【发布时间】:2017-03-15 18:54:46
【问题描述】:

我正在执行 GET 请求,并且在我的 URL 中有一个用于搜索字符串类型过滤器的参数。

事实证明,偶尔用户可以插入斜杠(“/”)作为过滤器,然后出现错误。

网址: http://localhost:8080/api/routes/skip/take/search=

示例: http://localhost:8080/api/paths/0/10/name=/

【问题讨论】:

    标签: parameters get request


    【解决方案1】:

    在执行 GET 之前,您可以考虑对搜索字词进行 urlencoding。 (斜杠“/”编码为 %2f。)

    看看this article,它对上述内容进行了扩展。

    【讨论】:

      猜你喜欢
      • 2021-09-06
      • 2018-05-14
      • 1970-01-01
      • 2021-08-24
      • 1970-01-01
      • 1970-01-01
      • 2020-04-12
      • 1970-01-01
      • 2019-09-29
      相关资源
      最近更新 更多