Java – when putting a new row into the MySQL table Created add what URI
•
Java
I'm doing a restful service. I use post sometimes. I add a new row to the table Therefore, it seems a good idea to succeed by looking for here 201 Although what puzzles me is that if I use response Created (URI), what should I add to the URI?
Solution
The URI should 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 creates (Java. Net. URI location) - the URI of the new resource
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2 "The newly created resource can be referenced by the URI returned in the response entity"
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码