Can we Include Documents in a POST?


#1

Is the following request allowed:

POST /articles?include=author

Where a new article is created and in the response body, the newly created article is returned along with an included array including all related authors to that new article?


#2

From the spec:

An endpoint MAY also support an include request parameter to allow the client to customize which related resources should be returned.

And:

Note: This section applies to any endpoint that responds with primary data, regardless of the request type. For instance, a server could support the inclusion of related resources along with a POST request to create a resource or relationship.

So yes!