How to configure Spring Data REST to return the representation of the resource created for a POST request? -


i following spring-data-rest guide accessing jpa data rest. when http post new record inserted (and response 201). great, there way configure rest mvc code return newly created object? i'd rather not have send search request find new instance.

you don't have search created entity. http spec suggests, post requests returning status code of 201 created supposed contain location header contains uri of resource created.

thus need issuing get request particular uri. spring data rest has 2 methods on repositoryrestconfiguration.setreturnbodyoncreate(…) , ….setreturnbodyonupdate(…) can use configure framework return representation of resource created.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -