onyxframework / http

An opinionated framework for scalable web 🌎
https://onyxframework.com/http
MIT License
142 stars 11 forks source link

Add ability to require certain param types #59

Closed vladfaust closed 5 years ago

vladfaust commented 5 years ago
  params do
    json require: true do
      type content : String
    end
  end

Would return 400 JSON payload required if content type is not "application/json" or the body is missing.

It is useful for applications which work with JSON requests only.