Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

pass a list of string as PathVariable to api spring boot

GET http://localhost:8080/public/test/1,2,3,4

@RequestMapping(value="/test/{firstNameIds}", method=RequestMethod.GET)
@ResponseBody
public String test(@PathVariable String[] firstNameIds)
{
    // firstNameIds: [1,2,3,4]
    return "Dummy"; 
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #list #string #PathVariable #api #spring #boot
ADD COMMENT
Topic
Name
1+5 =