I am using Rest Assured for API testing, how do I send array objects in a POST? For a plain string I know I can do something like this
JSONObject json = new JSONObject();
json.put("firstname", "John"));
json.put("lastname", "James");
request.body(json.toJSONString());
request.post("/my/post/url/end/point");
How do I send an object like this using the JSONObject and Rest Assured?
{
"price": "234",
"phoneNumber": "09022334422",
"owner": [{
"digits": "1122334455",
"myname": "Abisoye Haminat",
"code": "058",
"default": "true"
}]
}