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'm having a problem when I trying to get parameters from a PUT request and I believe is is a bug of the framework.
When the method getRestParams() is called, it tries to parse the rawBody.
The method getRawBody() returns the value of file_get_contents('php://input')
The function file_get_contents('php://input') returns the value:
{"foo": "foo content", "bar": "bar content"}
The function getRestParams() tries to parse this content calling the function mb_parse_str
The text was updated successfully, but these errors were encountered:
pedrocalgaro
changed the title
Erro with PUT parâmeters in CHttpRequest ( method getRestParams() )
Error with PUT parâmeters in CHttpRequest ( method getRestParams() )
Jul 18, 2014
pedrocalgaro
changed the title
Error with PUT parâmeters in CHttpRequest ( method getRestParams() )
Error with PUT parameters in CHttpRequest ( method getRestParams() )
Jul 18, 2014
Yii does not support JSON requests by default, to enable json input you have to extend CHttpRequest and override getRestParams(). In yii 2.0 we already have support for this. marking this as a feature request.
Hi everyone,
I'm having a problem when I trying to get parameters from a PUT request and I believe is is a bug of the framework.
When the method getRestParams() is called, it tries to parse the rawBody.
The method getRawBody() returns the value of file_get_contents('php://input')
The function file_get_contents('php://input') returns the value:
The function getRestParams() tries to parse this content calling the function mb_parse_str
But this returns:
So I changed the line: (https://github.com/yiisoft/yii/blob/master/framework/web/CHttpRequest.php#L290)
To:
And after that, it works like a charm.
You could look at it?
The text was updated successfully, but these errors were encountered: