Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Is there way to access HTTP PUT-parameters with \Phalcon framework?

Hello.

We want to implement full REST in our application (this is means we want to enable "PUT" and "DELETE" queries in the API).

There is one trouble with "PUT"-query parameters: Payload parameters of HTTP-PUT-request does not exists In the $_GLOABALS. So we can't access them through $this->request->get() ($this->request is \Phalcon\Http\Request).

But if we read 'php://input' we can see all passed "PUT"-parameters. Is there way to access parameters with \Phalcon framework or we need to parse "manually" every "PUT"-request?



19.5k
Accepted
answer

To my knowledge the Request object does not handle those. In a similar project as yours I had to rely on php://input to give me the functionality I wanted when issuing a PUT.



24.5k

Thank you. We do the same now.

There is interesting feature: If we set $GLOBALS["PUT"] manually then $this->request->get() returns data from $_PUT array correctly :).