Database¶
- POST /(db)¶
Create a new Container
Creates a new container on the database
Permission: guillotina.AddContainer
Context: guillotina.interfaces.content.IDatabase
http
POST /db HTTP/1.1 Accept: application/json Authorization: Basic cm9vdDpyb290 Content-Type: application/json { "@type": "Container", "id": "container" }
curl
curl -i -X POST http://nohost/db -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"@type": "Container", "id": "container"}' --user root:root
httpie
echo '{ "@type": "Container", "id": "container" }' | http POST http://nohost/db Accept:application/json Content-Type:application/json -a root:root
response
HTTP/1.1 200 OK Content-Type: application/json Location: /db/container { "@type": "Container", "id": "container", "title": "container" }
- Status Codes:
200 OK -- Container result
401 Unauthorized -- You are not authorized to perform the operation
404 Not Found -- The resource does not exist
- GET /(db)¶
Get list of containers
Permission: guillotina.GetContainers
Context: guillotina.interfaces.content.IDatabase
http
GET /db HTTP/1.1 Accept: application/json Authorization: Basic cm9vdDpyb290
curl
curl -i -X GET http://nohost/db -H "Accept: application/json" --user root:root
httpie
http http://nohost/db Accept:application/json -a root:root
response
HTTP/1.1 200 OK Content-Type: application/json { "containers": [ "container" ], "@type": "Database" }
- Status Codes:
200 OK -- Get a list of containers
401 Unauthorized -- You are not authorized to perform the operation
404 Not Found -- The resource does not exist