ravendbravendb-http

How to get a document from Raven using the HTTP API


We have Raven deployed on a server and our .NET code can work with it just fine.

When remoted onto the box, I would like to be able to make HTTP calls to Raven through an HTTP client.

I can see in Raven studio that I have a document in a collection called 'Locations' with the ID of 'locations/1'. Raven is running on port 9999, so in my HTTP client (Postman for Chrome) I'm entering the following GET request:

http://localhost:9999/docs/locations/1

However, I always get 404.

If I malform the URL (e.g. by changing the 'docs' segment to 'documents') I get a response from Raven telling me it doesn't know what to do with the request, so I must be on the right lines. Raven just appears to be telling me the document isn't there, when I know it is.

Can anyone offer some insight?


Solution

  • That URL would address the system database. I assume you are using a named database.

    Try http://localhost:9999/databases/{DbName}/docs/locations/1