Facts:
REST specification for POST states :
"POST : Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation."
I have read somewhere this URI is sent in response header 'Location'.
I am using angularjs for javascript client and Jersey for server responding REST requests.
When both client and server are present in the same package and deployed togheter, the 'Location' header is present to javascript client: All is working fine !
When client and server are deployed in different sites the 'Location' header is not present to javascript client.
- NOTE1 : Cross-origin resource sharing : CORS is used in order to enable interaction: It is not clear for me if in this situation 'Location' header should be present to javascript client.
- NOTE2: 'Location' header is always being produced by server and it arrives to client browser (it is displayed in devtools of client browser).
My question: What to do in javascript client in order to know the URI of created instance ?
- Must I use other than POST (may be PUT) ?
- Must I fire a second GET search request (after POST) in order to get recently created URI.
NOTE3 : I have read question here and a lot more before asking here.
Thanks in advance, W