2

I'm trying to call a URL with commas, curly braces and square brackets in it.

With Feign, here is how I begin :

@FeignClient(name="FinancialTimesFeignClient", url="https://markets.ft.com/data/equities/ajax/updateScreenerResults")
public interface FinancialTimesClient {
    @GetMapping(value="?data=[a,b]")
    FinancialTimesDto getTickers();
}

The problem is that the url should end with data=[a,b] but I get this:

GET /data/equities/ajax/updateScreenerResults?data=[a&data=b]

It won't be understood by the server. Can I disable the rewriting?

Samuel
  • 594
  • 1
  • 6
  • 22
  • does `[a,b]` really need to be hardcoded in the url or should it depends on some arguments passed to `getTickers` method ? – cerdoc Jul 07 '22 at 21:51
  • this needs to be hardcoded – Samuel Jul 08 '22 at 18:30
  • Thank you @cerdoc ! I've been able to make it work by passing this table as a String RequestParam argument instead of the hardcoded form. Please answer the question so I can accept it. – Samuel Jul 10 '22 at 14:58

1 Answers1

2

You can pass the value of data as a String RequestParam to your method getTickers so that it will be append to the URL :

...
 @GetMapping
 FinancialTimesDto getTickers(@RequestParam String data);
...
cerdoc
  • 473
  • 2
  • 8