Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
any Rest example ?
  • hi, is there any example of REST with FUELphp ? need example of rest auth and posting and getting data (json) thanks
  • hi, basicaly you need to create config file, in app/config/rest.php like this: http://scrp.at/7v
    just change 'auth' to 'basic', and add valid logins. and example rest is: http://scrp.at/7w protected $_supported_formats = array(
    'json' => 'application/json'
    );
    - this makes sure that only JSON is allowed public function get_regions() - makes sure it's GET request, since prefix is get_
    and if you want post, it would look like: public function post_addsmth() {} Good luck! :)
  • Jaroslav Petrusevic wrote on Sunday 10th of July 2011:
    hi, basicaly you need to create config file, in app/config/rest.php like this: http://scrp.at/7v
    just change 'auth' to 'basic', and add valid logins. and example rest is: http://scrp.at/7w protected $_supported_formats = array(
    'json' => 'application/json'
    );
    - this makes sure that only JSON is allowed public function get_regions() - makes sure it's GET request, since prefix is get_
    and if you want post, it would look like: public function post_addsmth() {} Good luck! :)

    thanks but i need see authorization example too, i dont know how i can authorise user
  • I'd like to see Authentication also

Howdy, Stranger!

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

In this Discussion