Home > Software engineering >  How to define id in POST request using Ravendb
How to define id in POST request using Ravendb

Time:09-22

Hello there

I'm having a trouble when I try to insert a document into a Ravendb Server which is running in my other computer. I can retrieve documents easily, but when I try to use REST API with POST request I get this error

"System.ArgumentException","Message":"Query string value 'id' must have a non empty value","Error":"System.ArgumentException: Query string value 'id' must have a non empty value

even though I have my Id defined like this:

{ "id":"adawd", "name":"genereicname", "password":"something" }

Originally I'm making a flutter application but currently I'm just testing the API with Postman.

I messed around with id's (String, int) tried to leave it empty but no luck, does anyone know how to define Id for raven db to send me that sweet 200 response code...

CodePudding user response:

According to the documentation you should use PUT to upload a new document or modify an existing one.

See: enter image description here

  • Related