0

My controller-class:

@RestController
 @RequestMapping(value = UserRestController.REST_URL, produces = 
 MediaType.APPLICATION_JSON_VALUE)
public class UserRestController  {

 @GetMapping
public List<User> getByParameter(@RequestParam Map<String, String> parameters) {
    logger.info("PARAMETER VALUE " + parameters.get("phone"));
    return service.getByParameter(parameters);
    }

}

When I run get-request on

http://localhost:8080/test/customers?phone=+78122347389

it does not return any result, as it does not see '+'.

Indeed, in log I see:

PARAMETER VALUE  78122347389

May be problem in encoding?

Jelly
  • 972
  • 1
  • 17
  • 40
  • 1
    Does [this post](https://stackoverflow.com/questions/2828211/how-to-include-special-characters-in-query-strings) answers your question? – Imaguest Feb 20 '20 at 16:40
  • Yes, thank you. I use URLEncoder.encode to encode param-value from Map parameters – Jelly Feb 20 '20 at 17:21

0 Answers0