I am using microservices using spring boot in my application,
I use RestTemplate to call other component services from "org.springframework.web.client.RestTemplate".
I have a common service from my component which calls other components to fetch data.
Whenever my search text has a backslash like "test\" my API call fails. After debugging I came to the conclusion that till restTemplete.exchange API is not failing and I am not getting any requests in other component API methods.
// restTemplete.exchange(serviceUrl, HttpMethod.POST, request, responseType);
If I put 'text\t' API call is successful and control is reaching the other component not sure if I am missing anything on this. How do I escape the escape character?
I have tried text.replace("\\", "\\\\");
, but still no success.