module Roda::RodaPlugins::InvalidRequestBody::RequestMethods
def POST
Handle invalid request bodies as configured if the default behavior
def POST super rescue => e handle_invalid_request_body(e) end
def handle_invalid_request_body_empty_400(e)
def handle_invalid_request_body_empty_400(e) response.status = 400 headers = response.headers headers.clear headers[RodaResponseHeaders::CONTENT_TYPE] = 'text/html' headers[RodaResponseHeaders::CONTENT_LENGTH] ='0' throw :halt, response.finish_with_body([]) end
def handle_invalid_request_body_empty_hash(e)
Treat invalid request bodies by using an empty hash as the
def handle_invalid_request_body_empty_hash(e) {} end
def handle_invalid_request_body_raise(e)
Raise a specific error for all invalid request bodies,
def handle_invalid_request_body_raise(e) raise Error, e.message end