Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Yii2 as dependency of REST module #2562
I use REST module to test my Yii2 application rest controllers so my functional tests config looks like this:
So REST module uses Yii2Connector as a client to send requests. Considering that REST module encodes parameters to JSON string Yii2 client gets only raw body message here:
Now, if we look at the yii\web\Request body parameters parsing we see this:
and _bodyParams here is an empty array, so I cannot get my payload and parse it as a json. Am I doing everything right?
My test example:
Record is not updated because raw body was not parsed
You missed the parsing part in getBodyParams:
Have you configured a parser for application/json?
My request component config:
The problem is not in parsing itself. The Request never reached this point because in moment when getBodyParams is called the _bodyParams variable equals an empty array which is not NULL