Answers for "@getMapping one overloading URL"

0

@getMapping one overloading URL

@GetMapping("/endpoint")
public Response getStuff(@RequestParam(value = "foo", required = false) String foo, 
			@RequestParam(value = "bar", required = false) String bar) {
		
		if (foo != null)
			// do stuff for foo
		else if (bar != null)
			// do stuff for bar
}
Posted by: Guest on September-29-2021

Browse Popular Code Answers by Language