At work, we need to build an API based on RESTful style. When the http method is equal to PATCH
, there is no $this->request->getPatch()
method. Use Neither $this->request->getPut()
nor $this->request->getPost()
can obtain the submitted data.
Is there any way to easily obtain patch data?
I didn’t find a solution online, so I implemented it myself based on phalcon’s request object
getPatch()
和hasPatch()
.Specific usage:
You only need to inject your own Request class into the dependency to call the getPatch() method in the project
The specific code is on Github:
https://github.com/baohanddd/...