Rishabh Bansal
Rishabh Bansal

Reputation: 392

Can we implement the Two Get Request on the same resource

Can any here suggest how can i implement the two GET request with different parameter on the same resource's function.

ex:

GetMapping("/Transaction")
GetMapping("/Transactions")

Upvotes: 3

Views: 92

Answers (1)

Andrew
Andrew

Reputation: 49646

@GetMapping(path = {"/Transaction", "/Transactions"})

path is a String[], so you can specify more than one path.

Upvotes: 2

Related Questions