Call Rest Post: Store messagebody in latestHttpResponse - Mendix Forum

Call Rest Post: Store messagebody in latestHttpResponse


You get the option to store the response body in the latestHttpResponse, but only while errorhandling:

The response body is often during debugging and/or logging very useful information.

You might want to restrict it for large response bodys but otherwise there seems to be no major reason not to store the response body.

Edit: Changed the Response Handling from "Store in String" to "Apply import mapping" which is a better usecase for this request


3 answers

Joost, Rom, see my edited image. I want to use the import-mapping option that the 'call-REST'-activity offers but using an import mapping makes the call-activity a black box.

Two disadvantages:

  • Examining the responsebody of succesful calls is not  possible here. Setting the trace-level usually is only possible on my local machine, and has to be done upfront
  • logging the response-body is not possible. We use this quite often for better control of our integration-history.

In your screenshot, you store the response in a string. You can also choose Store in an Http Response there, which gives you an HttpResponse variable, including the content. Why would you want to have it in $latestHttpResponse?


Your response body would be plain JSON. You can retrieve that fairly easily when you set the REST CONSUME log level to TRACE. What would this feature add, since all you can do with the string is just copy/paste it to some other application.