Object
A Rack middleware for parsing POST/PUT body data when Content-Type is not one of the standard supported types, like application/json.
TODO: Find a better name.
Supported Content-Types
Constants
# File lib/rack/contrib/post_body_content_type_parser.rb, line 27 def initialize(app) @app = app end
# File lib/rack/contrib/post_body_content_type_parser.rb, line 31 def call(env) case env[CONTENT_TYPE] when APPLICATION_JSON env.update(FORM_HASH => JSON.parse(env[POST_BODY].read), FORM_INPUT => env[POST_BODY]) end @app.call(env) end
[Validate]
Generated with the Darkfish Rdoc Generator 2.