This URL really looks very strange, also these braces would be a source of error in an URL, they would need to be replaced by %7B
and %7D
I think you would be better off using a simpler one such as, for example:
api/v1/query?query=up&device=Device_1
And then declare your controller this way:
@RequestMapping(value="/api/v1/query", method = RequestMethod.GET)
public String getLastPosting(@RequestParam(value="query") String query,
@RequestParam(value="device") String device) {
}
Other options would be using Unicode for curly braces (but I don't recommend these)
/api/v1/query=up%7Bdevice="Device_1"%7D
@RequestMapping(value="/api/v1/{query}",method = RequestMethod.GET)
public String getLastPosting2(@PathVariable("query") String query){
// query is query=up{device="Device_1"}
// you would need to parse it to extract the device name
}
or
/api/v1/query=up%7Bdevice="Device_1"%7D
@RequestMapping(value="/api/v1/query",method = RequestMethod.GET)
public String getLastPosting3(@RequestParam("query") String query){
// query is up{device="Device_1"}
// you would need to parse it to extract the device name
}