I'm im using zendframework/zend-diactoros
with Laravel. I have a problem when I sent json data like
{
"data": {
"value": ""
}
}
Then, in controller
// @var $request Psr\Http\Message\ServerRequestInterface
var_dump($request->getParsedBody())
/*
array:1 [
"data" => array:1 [
"value" => null // I expect "value" => ""
]
]
More examples:
I sent
{
"data": {
"value": null
}
}
var_dump
var_dump($request->getParsedBody())
/*
array:1 [
"data" => array:1 [
"value" => null // that's OK
]
]
I sent
{
"data": {
"value": "x"
}
}
var_dump
var_dump($request->getParsedBody())
/*
array:1 [
"data" => array:1 [
"value" => "x" // that's OK
]
]
Only first example has a problem, but I dont have any idea if this is correct. Maybe exists a way to dump exact received data with this PSR7 library.