DatabaseΒΆ
GET
Get list of containers
permission
: guillotina.GetContainersGET /db HTTP/1.1
Accept: application/json
Host: localhost:8080
Authorization: Basic cm9vdDpyb290
curl -i http://localhost:8080/db -H 'Accept: application/json' --user root:root
http http://localhost:8080/db Accept:application/json -a root:root
requests.get('http://localhost:8080/db', headers={'Accept': 'application/json'}, auth=('root', 'root'))
HTTP/1.1 200 OK
Content-Type: application/json
Server: Python/3.6 aiohttp/2.2.5
{
"@type": "Database",
"containers": [
"container"
]
}
POST
Create a new Container
permission
: guillotina.AddContainerPOST /db HTTP/1.1
Accept: application/json
Host: localhost:8080
Content-Type: application/json
Authorization: Basic cm9vdDpyb290
{
"@type": "Container",
"id": "container",
"title": "Container"
}
curl -i -X POST http://localhost:8080/db -H 'Accept: application/json' -H 'Content-Type: application/json' --data-raw '{"@type": "Container", "id": "container", "title": "Container"}' --user root:root
echo '{
"@type": "Container",
"id": "container",
"title": "Container"
}' | http POST http://localhost:8080/db Accept:application/json Content-Type:application/json -a root:root
requests.post('http://localhost:8080/db', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'@type': 'Container', 'id': 'container', 'title': 'Container'}, auth=('root', 'root'))
HTTP/1.1 401 Unauthorized
Content-Type: application/json
Server: Python/3.6 aiohttp/2.2.5
{
"error": {
"message": "Duplicate id",
"type": "NotAllowed"
}
}