Open natlibfi-arlehiko opened 7 years ago
This seems like a good idea. It avoids the extra reads in case the newly created record is not needed.
Perhaps the header name should be just Resource-ID. Just in case the same API design will be implemented for Aleph etc. also.
Good point. Modified the "spec" above.
Creating a new bibliographic record calling POST /bib returns 201 Created and sets the Location response header to point to the newly created resource.
To know the ID of the newly created resource the client must either parse the ID from the URL set in the Location header or call GET /bib/ and parse the ID from the data.
Suggested implementation
Write the ID of the newly created resource to Resource-ID header.