GET http://test.local/test
yii\web\Request::getParsedBody()Expected: null according to PSR
Actual: Exception thrown here
The exception your refer indicates that request should have a body according to RFC, e.g. its content type header, but it does not hold any content.
Perhaps, there must be an extra check for empty body somewhere, perhaps not - that is hard to say at the first glance.
Confirmed. This is definitely a bug to be fixed.
At the present state following common controller code throws an exception:
public function actionCreate()
{
$model = new Foo();
if ($model->load(Yii::$app->request->post())) { // throws `UnsupportedMediaTypeHttpException`
$model->save();
}
...
}
Most likely bug was inttroduced during the pursuit for #14522 or #14458
Resolved by commit 854ae7127cba009def2496075fc90c03c5699d8c
Most helpful comment
Resolved by commit 854ae7127cba009def2496075fc90c03c5699d8c