I have the following question for you. Currently I am having a RestController that allows calls like this:
@RequestMapping(value = "/notifications", method = RequestMethod.POST)
public void postNotification(@RequestBody final Notification notification) {
//DoStuffWithTheNotification
}
And here is the notification class:
@JsonPropertyOrder({"body", "sound", "other})
public class Notification {
@JsonProperty
String body;
@JsonProperty
String sound;
@JsonProperty
String other;
// Bunch of getters,setters and what not
}
Now what I want to do is the following : I want to make a POST-request to this URL, but instead of providing a json-file in the body (as my code would suggest), I would like to call it with an XML-file in the body. Is there an easy way to do this, without making an entirely new Notification object?