class JSONAPI::MediaTypeHandler

Overview

HTTP::Handler enforcing JSON:API v1.1 ยง6.2 Content-Type (415) and Accept (406) content negotiation rules, and setting Content-Type: application/vnd.api+json on responses.

Included Modules

Defined in:

jsonapi/media_type_handler.cr

Constant Summary

ALLOWED_PARAMETERS = Set {"ext", "profile"}
BODY_METHODS = Set {"POST", "PATCH", "PUT"}

Constructors

Instance Method Summary

Constructor Detail

def self.new(prefix : String = "/api", set_response_content_type : Bool = true) #

[View source]

Instance Method Detail

def call(context : HTTP::Server::Context) : Nil #

[View source]
def prefix : String #

[View source]
def set_response_content_type? : Bool #

[View source]