Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
rest_controller post
  • Hi,

    I have a question. I have the following function in my rest_controller, but when I want to echo the data that is posted, it's not working...

    ----------------------------------------------------------------------------------------
    curl -X POST -i -H "Content-type: application/json" -X POST https://www.testserver.example/api/deauthorize -d '{"test":"test1"}'

    ----------------------------------------------------------------------------------------

    public function post_deauthorize()

        {

            print_r(\Input::post());

        }

  • mmm it seems \Input::json(); is working...
  • That is because it's not posted as multipart/form-data, so PHP can not parse it as POST variables. Input::json() parses php:://input directly.
  • i think it sould be 

    public function action_deauthorize()

        {

            print_r(\Input::post());

        }

Howdy, Stranger!

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

In this Discussion