We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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.

$this->request->getDelete() ?

How to get data from DELETE request? I see on stackoverflow the process to get data from DELETE request is same with the process to get data from PUT request. I have tried $thiis->request->getPut() it is not working.



33.7k
Accepted
answer

$this->request->getPut() works. But you are right, there isn't a getDelete() method. Try using $this->request->get() to maybe get a workaround.

@phalcon



98.9k

That depends on how you pass the data from the client, if you do so in JSON, $this->request->getPut() should work for you



7.9k
edited Nov '14

I have tried JSON data, it also not working, $this->request->getPut() always return null

That depends on how you pass the data from the client, if you do so in JSON, $this->request->getPut() should work for you



7.9k

using query string as @RompePC described :)

thanks everyone