class UsersCreate < Goliath::API
use Goliath::Rack::Formatters::JSON
use Goliath::Rack::Render, 'json'
use Goliath::Rack::Params
use Goliath::Rack::Validation::RequiredParam, {:key => 'token',
:message => 'is required'}
def response(env)
[200, {'Content-Type' => 'application/json'}, {response: 'user created'}]
end
end
With the above code, if I do `curl -H "Accept:application/json" "
http://localhost:8000"` shouldn't I be seeing {'error' => 'token is required'}? Instead I still see [:error, "token is required"].
I included JSON formatter and specified 'Accept' header, not sure what's going on here.
Regards.