[Q]: $request->parsedBody() is null on JSON request #953
Answered
by
rustatian
cnizzardini
asked this question in
Q&A
-
I am getting curl -X 'POST' \
'http://localhost:8080/actors' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "string",
"last_name": "string"
}' I can see the request body though by doing this: ob_start();
$body = $request->getBody();
$body->rewind();
$body->getContents();
$out = ob_get_contents();
file_put_contents('/tmp/log.txt', $out);
ob_end_clean(); This lead me to here: #11 That issue is quite old though. Is it correct that we must handle parsing JSON body in our worker? Any other gotchas I should be aware of as I play around with this? |
Beta Was this translation helpful? Give feedback.
Answered by
rustatian
Jan 20, 2022
Replies: 1 comment
-
Hey @cnizzardini 👋🏻
Yep, that's correct.
I guess nothing more than was in the #11. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cnizzardini
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @cnizzardini 👋🏻
Yep, that's correct.
I guess nothing more than was in the #11.