$latestHttpResponse part is incomplete or incorrect. You could use here: paranthesis.

0
I'm trying to get a method in an API using the CALL REST action in Mendix. I'm currently receiving an error, and even though I've set the Rest Consume log level to trace in the production environment, I can't see any error codes. Therefore, I created a custom error handling system with rollback and wrote the following code for the log message, but I'm still getting the error in the title: $latestHttpResponse part is incomplete or incorrect. You could use here: paranthesis.   IF $latestHttpResponse/StatusCode != 200 THEN  Log Message:    'REST Error- ' +     'Code: ' + toString($latestHttpResponse/StatusCode) +     ', Reason: ' + $latestHttpResponse/ReasonPhrase +     ', Contents: ' + $latestHttpResponse/Content THROW custom error (optional)
asked
1 answers
4

Hello AYBERK,

You can try the API in Postman or swagger and check whether getting response there or not.

error incomplete may be due to $latestHttpResponse/Content is empty or not in the expected format.

Please ensure header in your REST call is set to application/json or the expected content type. If you will be able to get content in post man, then you can use the same setting in REST call.

In the given example in your question first try to remove $latestHttpResponse/Content part and then you can confirm it is due to content.

image.png

 

 

 

answered