-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add http examples for example DB endpoints (#12)
* Add http examples for example DB endpoints * address PR comments
- Loading branch information
1 parent
8281549
commit 288b9b1
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@hostname=localhost | ||
@port=4444 | ||
@address=http://{{hostname}}:{{port}} | ||
|
||
### Get a document by ID. | ||
# Returns an `ExampleDocument`, or `null` if there is no document with the given ID: | ||
# { | ||
# _id: u32, | ||
# string: String, | ||
# number: i32 | ||
# } | ||
# | ||
# @prompt id The ID of the document to get | ||
|
||
GET {{address}}/read/{{id}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@hostname=localhost | ||
@port=4444 | ||
@address=http://{{hostname}}:{{port}} | ||
|
||
### Insert or update a document (of type `ExampleDocument`). | ||
# Returns HTTP status code only. | ||
# | ||
# @prompt id The ID of the document to insert or update | ||
# @prompt string An arbitrary string to store in the document | ||
# @prompt number An arbitrary 32-bit integer to store in the document | ||
|
||
PUT {{address}}/write | ||
Content-Type: application/json | ||
|
||
{ | ||
"_id": {{id}}, | ||
"string": "{{string}}", | ||
"number": {{number}} | ||
} |