Headless / Accessing content as an API

For versions 0.2.2 and above, any content route in Lynicon is automatically configured to return the content on any URL as a JSON object if you set up the appropriate Accept headers. The way this works is:

  • If the Request has an Accept header with any of '*/*', 'text/html' or 'application/xhtml+xml', an HTML page is returned
  • Otherwise a JSON content object is returned.