module
Orion::Controller::JSONHelpers
Overview
JSON Response Helpers Simplified JSON rendering
Usage: get "/api/users" do json({users: all_users}) end
Direct including types
Defined in:
orion/controller/json_helpers.crInstance Method Summary
-
#json(data, status : Int32 = 200)
Render JSON response
- #json_accepted(data)
- #json_bad_request(data)
- #json_created(data, location : String | Nil = nil)
- #json_forbidden(data)
- #json_internal_server_error(data)
- #json_not_found(data)
-
#json_ok(data)
Render JSON with specific status
- #json_unauthorized(data)
- #json_unprocessable_entity(data)
-
#jsonp(data, callback : String = "callback", status : Int32 = 200)
Render JSONP response