I have a query where i pass a string and the string can comes with plus value in front of the value.
- Passed plus sign (+) in front of a parameter value. Browser ignored it and received value in REST API without plus sign and with/without spaces
- Changed Plus sign (+) or space as %2b in the incoming value after the value is received, however it converted all the spaces in the value as + or space can be in the middle or anywhere of the value
- Written a custom wrapper which extends
HttpServletRequestWrapperand changed the parameter value from space or plus with (%2b) for the first occurences of Plus Sign (+), however when it hits the REST API, it converts the plus as space again
How to get the actual value in REST API without any issues?
Example
http://localhost:8080/trial/end?key=++123++
http://localhost:8080/trial/end?key=123
http://localhost:8080/trial/end?key=123++
http://localhost:8080/trial/end?key=++123+Abc+
Thanks.