You can use standard content negotiation to request API results in specific formats. Sapi-NT supports - in order of priority - query parameter, path extension and Accept header based content negotiation.
By default, each endpoint supports the following content types:
| Name | Media Type |
|---|---|
| html | text/html |
| json | application/json |
| csv | text/csv |
| ttl | text/turtle |
| rdf | application/rdf+xml |
Some endpoints also support GeoJSON:
| Name | Media Type |
|---|---|
| geojson | application/geo+json |
If the Sapi-NT application supports Excel spreadsheet format (XLS):
| Name | Media Type |
|---|---|
| xls | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
You can request a specific format by supplying the _format query parameter.
The value should be the name of a content type described above.
/path/example?_format=json
You can request a specific format by including a path extension in the request URL. The extension should be the name of a content type described above.
/path/example.json
You can request one or more specific formats by supplying Accept header values.
Each value should be the full media type of a content type described above.
curl -i -H "Accept: text/csv" /path/example