by Mikel Larreategi @erralin
Accept: application/json
GET /plone HTTP/1.1Standard browser response:
HTTP/1.1 200 OK
Content-Type: text/html
<html>
...
<body>
...
GET /plone HTTP/1.1 Accept: application/jsonAPI response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"@components": {
"actions": {
"@id": "http://localhost:55001/plone/@actions"
},
...
}
If we have a URL https://mysite.com/my-page the same URL works both for the browser and for the API
{
"@components": {
"breadcrumbs": {
"@id": "https://plonedemo.kitconcept.com/en/@breadcrumbs"
},
"navigation": {
"@id": "https://plonedemo.kitconcept.com/en/@navigation"
},
"workflow": {
"@id": "https://plonedemo.kitconcept.com/en/@workflow"
}
},
"@id": "https://plonedemo.kitconcept.com/en",
"@type": "LRF",
"UID": "fc836cdd270c41edbcae38c05708204c",
"contributors": [],
"created": "2018-03-07T10:06:48+00:00",
"creators": [
"admin"
],
"description": "",
"effective": null,
"exclude_from_nav": true,
"expires": null,
"id": "en",
"is_folderish": true,
"items": [
{
"@id": "https://plonedemo.kitconcept.com/en/media",
"@type": "LIF",
"description": "",
"review_state": "published",
"title": "Media"
},
{
"@id": "https://plonedemo.kitconcept.com/en/frontpage",
"@type": "Document",
"description": "The ultimate Open Source Enterprise CMS",
"review_state": "published",
"title": "Welcome to Plone 5"
},
{
"@id": "https://plonedemo.kitconcept.com/en/demo",
"@type": "Folder",
"description": "Vestibulum dignissim erat id eros mollis vitae tempus leo ultricies. Cras dapibus suscipit consectetur.\nInteger tincidunt feugiat tristique. Sed et arcu risus. Nam venenatis, tortor ac tincidunt amet.",
"review_state": "published",
"title": "Demo"
}
],
"items_total": 3,
"language": "en",
"layout": "folder_listing",
"modified": "2018-03-07T10:06:48+00:00",
"parent": {
"@id": "https://plonedemo.kitconcept.com",
"@type": "Plone Site",
"description": "",
"title": ""
},
"review_state": "published",
"rights": "",
"subjects": [],
"title": "English",
"version": "current"
}
This approach is being used already in at least 2 sites:
This is the most important thing that has happened in our world since long time ago
It's something that assures that we will be able to jump to python 3
For those who say that Plone is old, and has no future