When POSTing an entity using REST, you would expect to get that created entity back (particularly to be able to see computed fields, like the id
and created
fields), but Drupal 8.0.x's REST implementation does not do this. All you get is a Location
header that points to the URL for this entity.
Consequently, in Drupal 8.0.x you first have to POST an entity and then GET it (using the value of the Location
header in the response). This is both painful and slow (2 round trips instead of one).
As of Drupal 8.1.0, Drupal's entity REST responses (\Drupal\rest\Plugin\rest\resource\EntityResource::post()
) returns the created entity.