How to deal with nested objects via http POST request?
I have seen
this section. So I understand how to deal with nested objects in shell.
But I don't know how to deal with nested objects in POST request...
And I imagine that Answer Object will be created by this way:
{"id": 1, "contents": "How old are you?"}
{"id": 1, "contents": "13"}
But it doesn't....
Creating Question object is good.
{"id": 1, "contents": "How old are you?"}
But Creating Answer object is not good.
I expected:
{"id": 1, "contents": "13"}
But actually I got:
{
"category": [
"This field is required."
],
"contents": [
"This field is required."
]
}
What should I do?
Thank you for reading. :)