Which URI should be placed in Response.created when setting a new row to mysql table

I am doing a Restful service, where at some point using POST I add a new row to the table. Therefore, looking here 201 for success seemed to be a good idea. Although what confused me is what should I put in the URI if I use Response.created (URI)?

+4
source share
1 answer

URI must contain the path to the newly created resource

https://docs.oracle.com/javaee/6/api/javax/ws/rs/core/Response.html

public static Response.ResponseBuilder created (location java.net.URI) location - URI of the new resource

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2 " URI (), "

0

Source: https://habr.com/ru/post/1609119/


All Articles