I am writing a feign client
@RequestMapping(
path = "/TrackingServlet?CompanyName=Test&UserName=&BranchCode=",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
ResponseEntity<String> getInfo(
@RequestParam("DocumentNumbers") String bill);
when it is invoked the url becomes /TrackingServlet?CompanyName=Test&UserName&BranchCode
eliminating the = symbol, but the API needs it in that format, since its a third party API we cannot modify it.
Also tried
@RequestMapping(
path = "/TrackingServlet?CompanyName=Test&UserName=",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
ResponseEntity<String> getInfo(
@RequestParam("DocumentNumbers") String bill,
@RequestParam(name = "BranchCode", required = true) String BranchCode);
default ResponseEntity<String> getInfo(String bill) {
return getInfo(bill, "");
}
this will not even have the param BranchCode
I am using org.springframework.cloud:spring-cloud-starter-openfeign:2.1.1.RELEASE
Spring boot version 2.1.4.RELEASE
is there anyway or workarounds for keeping empty params in urls as it is ?
@RequestParam? - I'm_Pratik/TrackingServlet?CompanyName=Test&UserName=&BranchCode=&DocumentNumbers=12345- Jebilpathbut maybe try using a request interceptor or do as mentioned above and add them all as request parameters. - spencergibb=symbol is not there, even when we used newer versions. Now we are using spring request template, and it works fine with empty params in url,=symbol is not eliminated - Jebil