You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use phalcon without fpm & nginx, but I use Swoole as the web service.
In my issue,
when the client sends a request (method "PUT") to server.
In ordinary way, we will get the params by file_get_contents("php://input")
phalcon source code:
cphalcon/phalcon/http/request.zep
`public function getRawBody() -> string
{
var rawBody, contents;
let rawBody = this->_rawBody;
if empty rawBody {
let contents = file_get_contents("php://input");
/**
* We need store the read raw body because it can't be read again
*/
let this->_rawBody = contents;
return contents;
}
return rawBody;
}`
the content will be saved in $_rawBody and can not be modified by outer.
I hope there will be another way to set the $_rawBody,
like public function setRawBody($content) -> string
The text was updated successfully, but these errors were encountered:
As a workaround, you can define your own Request (extends from Phalcon) class with rawBody in the constructor and set it to DI on init app.
As you can see, Request haven't any methods to change the state. So, I'm against to not implement this method in a request (while request is not immutable).
Hi buddy:
I use phalcon without fpm & nginx, but I use Swoole as the web service.
In my issue,
when the client sends a request (method "PUT") to server.
In ordinary way, we will get the params by
file_get_contents("php://input")
phalcon source code:
cphalcon/phalcon/http/request.zep
`public function getRawBody() -> string
{
var rawBody, contents;
}`
the content will be saved in $_rawBody and can not be modified by outer.
I hope there will be another way to set the $_rawBody,
like
public function setRawBody($content) -> string
The text was updated successfully, but these errors were encountered: