Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Rest Controller and CORS Requests
  • As far as I understand, on CORS Request (http://www.html5rocks.com/en/tutorials/cors/), every request consists of 2 request. The options request and the request itself.

    How do I handle the OPTIONS requests in fuelphp?
  • HarroHarro
    Accepted Answer
    FuelPHP supports any HTTP method your webserver passes on to it. CORS needs to be enabled, and you should not have a webdav module active (in case of Apache) which hijacks the OPTIONS request.

    How you handle it in your code, it depends. You can use verb based routing (so route the options request to a specific controller/method), or a use verb-based action method (options_methodname). Same as you would do it with the other HTTP methods.
  • Ah, ok. Thank you!

Howdy, Stranger!

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

In this Discussion