Spring rest controller : decoding of requestparam ( ? encoded to %3F)

Viewed 121

currently we are facing one issue that we are using path variable and requestparam for on of our workflow like below:

@GetMapping(value = "/api/{cardId}")
    @ResponseStatus(org.springframework.http.HttpStatus.OK)
    public GetSomeResponse getTdsHistory( @PathVariable("cardId") String cardId,@RequestParam(required = false ) String transactionsFromTimestamp) {

Request:
<https://<hostname>/src/1/0/card/transactions/03195311-292a-474d-8ae0-c0bd4d6ccb0d?transactionsFromTimestamp=2020-03-20T11:07:10.793Z>

when this url is hit by client application, we are not getting value set for requestparam field - instead value is set to cardId field(which contains cardId along with transactionTimestamp)

Analysis:when logs have been searched, found that ? is getting replaced with %3F and as a result we are not getting required value into transactionsFromTimestamp.

can you please guide us how can we can avoid ? getting encoded to %3F format ?

0 Answers
Related