Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuel based CURL client redirects template if response != 200
  • 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.

    gist of the method


    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).

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion