The GET
verb is used for read-only operations. There are no side effects for which the client is responsible. So GET
should not be used to update or delete a resource or to make a new resource. Every system that understands the HTTP protocol assumes that a GET
request will not change the state of the system and hence will make assumptions based on that.
In order to get any document in RavenDB, we will basically create a GET
request and use the RavenDB docs
structure. Then we will specify the type of entity which will hold the document data and the document ID we want to retrieve from the server.
Once the GET
request is sent to RavenDB in order to retrieve a given document, it will respond with the contents of that document and an HTTP response code:
HTTP Method |
On Success |
On Error |
---|---|---|
GET |
HTTP/1.1 200 OK HTTP/ 1.1 304 Not Modified |
HTTP/1.1 404 Not Found |