Skip to content
Advertisement

Spring Rest Template Injects Value into Parameter with %

Can someone please explain to me what is happening in the following code?

If I run:

JavaScript

Spring tells me that the URL used is https://example.com/../username/path where username = user%25123 even though I set the username = user%123.

This is looking to me to be not a Spring issue, rather a URL encoding issue, but can anyone tell me where this extra 25 comes from?

Advertisement

Answer

%25 is a URL-encoded percent sign, so user%123 encodes to user%25123

More info: https://www.w3schools.com/tags/ref_urlencode.ASP

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement