Skip to main content

negotiate_results_format_with_default

Function negotiate_results_format_with_default 

Source
pub fn negotiate_results_format_with_default(
    accept: Option<&str>,
    default: QueryResultsFormat,
) -> Result<QueryResultsFormat, ApiError>
Expand description

Like negotiate_results_format, but absent / wildcard Accept values (*, */*) fall back to default instead of JSON.

The SPARQL query endpoint passes CSV so a client without an Accept gets text/csv SELECT and ASK bodies; the repository and namespace listings keep the JSON default of negotiate_results_format.