I made a small application to send curl requests to an api. I have a method that does most of the work sending the request and then parsing the response.
It works fine unless the curl response doesn't return 200 then for some reason the whole application tries to redirect into the 404 page like the curl request hijacks the regular controllers request object
If the request fails it throws a RequestStatusException, so you need to encapsulate the execute() call in a try/catch block (there are other exceptions possible too).