Class: Rack::LinkedData::ContentNegotiation

Inherits:
RDF::ContentNegotiation show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rack-linkeddata-30be12032382/lib/rack/linkeddata/conneg.rb

Overview

Rack middleware for Linked Data content negotiation.

Uses HTTP Content Negotiation to find an appropriate RDF format to serialize any result with a body being RDF::Enumerable.

Override content negotiation by setting the :format option to #initialize.

Add a :default option to set a content type to use when nothing else is found.

Examples:

use Rack::LinkedData::ContentNegotation, :format => :ttl
use Rack::LinkedData::ContentNegotiation, :format => RDF::NTriples::Format
use Rack::LinkedData::ContentNegotiation, :default => 'application/rdf+xml'

See Also:

Constant Summary

Constants inherited from RDF::ContentNegotiation

RDF::ContentNegotiation::DEFAULT_CONTENT_TYPE, RDF::ContentNegotiation::VARY

Instance Attribute Summary

Attributes inherited from RDF::ContentNegotiation

#app, #options

Method Summary

Methods inherited from RDF::ContentNegotiation

#accept_entry, #call, #find_content_type_for_media_range, #find_writer, #find_writer_for_content_type, #http_error, #http_status, #initialize, #not_acceptable, #parse_accept_header, #serialize

Constructor Details

This class inherits a constructor from Rack::RDF::ContentNegotiation