Context
I am using EasyCron (https://www.easycron.com) to ping an endpoint in my IHP app.
If the code on my app's side fails for some reason, I would like to set the HTTP status code to 503 or similar and display the errors in the response so that,
- the cron job is marked as failed on EasyCron and
- I can see the relevant IHP errors in EasyCron's cron job records.
Since my response is not going to be parsed by EasyCron, I don't need it to be in JSON format. It's just going to be saved in the logs.
Question
I see that there is renderJsonWithStatusCode
but since I have no need to parse the JSON and it is extra work to create JSON instances of my data, I would prefer to render a plain text response but with a custom status code. Is this possible?