Last active
February 16, 2021 15:55
-
-
Save vmleon/d9f9f10bf15eca415e882aecd76830d7 to your computer and use it in GitHub Desktop.
SODA books visual code rest client example
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
@db_url= | |
@user=admin | |
@password= | |
# CREATE Books | |
PUT https://{{db_url}}/ords/admin/soda/latest/books | |
Authorization: Basic {{user}}:{{password}} | |
### | |
# GET All Books | |
GET https://{{db_url}}/ords/admin/soda/latest/books | |
?fields=value | |
Authorization: Basic {{user}}:{{password}} | |
### | |
# INSERT Book | |
POST https://{{db_url}}/ords/admin/soda/latest/books | |
Authorization: Basic {{user}}:{{password}} | |
content-type: application/json | |
{ | |
"title": "Command and Control", | |
"author": "Eric Schlosser", | |
"score": 4.7, | |
"reviews": 1454 | |
} | |
### | |
# INSERT Book | |
POST https://{{db_url}}/ords/admin/soda/latest/books | |
Authorization: Basic {{user}}:{{password}} | |
content-type: application/json | |
{ | |
"title": "Surely Your're joking Mr. Feynman", | |
"author": "Richard P Feynman", | |
"score": 4.6, | |
"reviews": 3132 | |
} | |
### | |
# INSERT Book | |
POST https://{{db_url}}/ords/admin/soda/latest/books | |
Authorization: Basic {{user}}:{{password}} | |
content-type: application/json | |
{ | |
"title": "The Trial", | |
"author": "Franz Kafka", | |
"score": 4.3, | |
"reviews": 253 | |
} | |
### | |
# GET All Books | |
GET https://{{db_url}}/ords/admin/soda/latest/books | |
?fields=value | |
Authorization: Basic {{user}}:{{password}} | |
### | |
# GET Books (filter by title) | |
POST https://{{db_url}}/ords/admin/soda/latest/books | |
?action=query | |
&fields=value | |
Authorization: Basic {{user}}:{{password}} | |
content-type: application/json | |
{ | |
"title": "Command and Control" | |
} | |
### | |
# GET Books (filter by score) | |
POST https://{{db_url}}/ords/admin/soda/latest/books | |
?action=query | |
&fields=value | |
Authorization: Basic {{user}}:{{password}} | |
content-type: application/json | |
{ | |
"score": {"$gt": 4.5} | |
} | |
### | |
# GET Books (filter by reviews) | |
POST https://{{db_url}}/ords/admin/soda/latest/books | |
?action=query | |
&fields=value | |
Authorization: Basic {{user}}:{{password}} | |
content-type: application/json | |
{ | |
"reviews": {"$between": [1000, 2000]} | |
} | |
### | |
# TRUNCATE Books | |
POST https://{{db_url}}/ords/admin/soda/latest/custom-actions/truncate/books | |
Authorization: Basic {{user}}:{{password}} | |
### | |
# DROP Books | |
DELETE https://{{db_url}}/ords/admin/soda/latest/books | |
Authorization: Basic {{user}}:{{password}} | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment