如何在SpringRESTTemplate中禁用URL编码?

如何在SpringRESTTemplate中禁用URL编码?,spring,resttemplate,url-encoding,Spring,Resttemplate,Url Encoding,url包含字符串 \b\f\20170722_225714.jpg?lastModified=1507881481909 SpringRestTemplate在请求服务器时将其编码为以下内容 仅供参考,我需要禁用URL编码,以便服务器端可以使用“\”字符,因为这是一项业务需求,因为我们的web服务器Nginx已配置为根据包含“\”字符的请求路径执行一些检查。创建配置类并添加以下代码: String url = serverUrl + metadata.getUri(); response = r

url包含字符串

\b\f\20170722_225714.jpg?lastModified=1507881481909

SpringRestTemplate在请求服务器时将其编码为以下内容

仅供参考,我需要禁用URL编码,以便服务器端可以使用“\”字符,因为这是一项业务需求,因为我们的web服务器Nginx已配置为根据包含“\”字符的请求路径执行一些检查。

创建配置类并添加以下代码:

String url = serverUrl + metadata.getUri();
response = restTemplate.exchange(url, metadata.getAction(), requestEntity, metadata.getResponseType());
然后通过构造函数注入在任何类中自动连接RestTemplate。

创建一个配置类并添加以下代码:

String url = serverUrl + metadata.getUri();
response = restTemplate.exchange(url, metadata.getAction(), requestEntity, metadata.getResponseType());
然后通过构造函数注入在任何类中自动连接RestTemplate。

可能重复的