post example with body request as json file
Closed this issue · 2 comments
edson-19 commented
Please provide a POST method example using body request.
is there a way to set the body request from a json file?
thanks in advance for your support and time.
regards
Edson
edson-19 commented
I found how to populate the POSTBody request from a json string
using ObjectMapper:
import com.fasterxml.jackson.databind.ObjectMapper;
SubmitPOSTBody body;
String json = json();
ObjectMapper mapper = new ObjectMapper();
try {
body = mapper.readValue(json, SubmitPOSTBody.class);
Response<SubmitPOSTResponseBody> result =
Client.create().application.submit.post(body());
edson-19 commented
resolved how to populate body request from json file