【发布时间】:2020-08-15 18:11:20
【问题描述】:
当我使用 RestTemplate 访问在查询参数中包含特殊字符的 URL 时出现错误。
我的网址是这样的
https://someendpoint?q=countryCode:(AB+yz)&q=type.code:12345&q=banner.code:A1&q=openDate[*+TO+NOW%2B3MONTH]%20&q=!date:[*+TO+NOW]
有人可以帮助我如何使用 RestTemplate 对这种类型的 URL 进行编码。 当我通过浏览器或邮递员点击时,此 URL 工作正常。
【问题讨论】:
标签: spring-boot resttemplate urlencode spring-resttemplate