I've used Matlab's webwrite()
to make calls to a REST API, providing the requset params. However, I need to now make a call where the Request Body must be specified. Is there a way to do this?
The REST API is defined by a Java Spring controller, e.g.:
@PostMapping(value = "post")
public ResponseEntity<?> setMySTuff(
@RequestParam(name = "myId") int myId,
@RequestBody Collection<MyCustomObject> myObjList) {
THe data paramemter for webwrite seems intended for being a set of key/value request param pairs, and not a means of setting the request body.
If I remember correctly,
@RequestParam
is used for mapping values as query parameters, while@RequestBody
defines the content of the response. If my assumptions are valid, the Matlab equivalent should be: