String url = serverUrl + metadata.getUri();
response = restTemplate.exchange(url, metadata.getAction(), requestEntity, metadata.getResponseType());
Run Code Online (Sandbox Code Playgroud)
url 包含字符串
https://localhost/api/fm/info/dump/a \b\f\20170722_225714.jpg?lastModified=1507881481909
Spring RestTemplate 在请求服务器时将其编码为以下内容
https://localhost/api/fm/info/dump/a%5Cb%5Cf%5C20170722_225714.jpg?lastModified=1507881481909
仅供参考,我需要禁用 URL 编码,以便 '\' 字符在服务器端可用,因为这是一项业务要求,因为我们的 Web 服务器 (Nginx) 已配置为根据包含 '\ ' 特点。