I'm using Spring RestTemplate successfully like this:
String url = "http://example.com/path/to/my/thing/{parameter}";
ResponseEntity<MyClass> response = restTemplate.postForEntity(url, payload, MyClass.class, parameter);
And that is good.
However, sometimes parameter
is %2F
. I know this isn't ideal, but it is what it is. The correct URL should be: http://example.com/path/to/my/thing/%2F
but when I set parameter
to "%2F"
it gets double escaped to http://example.com/path/to/my/thing/%252F
. How do I prevent this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…