How to pass Java date as path variable in a rest get call
问题 There is an existing api which is having the below code : @GetMapping(value = "/getAmount") public long getAmount(){ Date d = new Date(); long amountFetchedFromDb = callToDatabase(d); return amountFetchedFromDb; } Now I need to change the functionality as below: @GetMapping(value = "/getAmount") public long getAmount(){ Date d = new Date(); <CALL TO A NEW REST API PASSING IT THE DATE d AND THE NEW API WILL MAKE THE DB CALL AND RETURN THE AMOUNT> return amount; } Now, I have created a new rest