I want to have one url for two functions. The first without parameters and the second with parameters.
code:
@RestController
public class MainController {
@GetMapping("/")
public String search(@RequestParam(value = "search") String... keys) {
return Arrays.toString(keys);
}
@GetMapping("/")
public String results() {
return "results!";
}
}
Right now it keeps throwing me an error. is there a solution for it?
Thanks.