Skip to main content

Content Negotiation

Content negotiation allows clients to request data in different formats.

Supported Formats

FormatContent-TypeDefault
JSON-LDapplication/ld+jsonYes
Turtletext/turtleWith --conneg
HTMLtext/htmlFor profiles

Requesting formats

Use the Accept header:

# Get JSON-LD (default)
curl http://localhost:3000/alice/public/data

# Get Turtle (requires --conneg)
curl -H "Accept: text/turtle" http://localhost:3000/alice/public/data

# Get HTML (for browsing)
curl -H "Accept: text/html" http://localhost:3000/alice/public/data

Enable Turtle support

jss start --conneg

Or via environment variable:

JSS_CONNEG=true jss start