Answer the question
In order to leave comments, you need to log in
How to pass json object as get parameter?
I'm trying to pass json in a get request, it fails, apparently some type of data is needed that is not HashMap
http://localhost:8080/mesure/create?values={test: "test"}
@RequestMapping(value = "/create")
public void setMesureId(@RequestParam(value = "values", required = false) HashMap<String, String> profileJson) {
}
Answer the question
In order to leave comments, you need to log in
GET -request involves getting data. If you need to send data, then do it using the POST method .
First, we need to serialize the transmitted data using URLEncode.
Secondly, you will need a converter that can turn the string into a HashMap.
in general, as i_visseri said , if you need to transfer some kind of payload, it is better to use POST requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question