Skip to content

class Athena::Routing::RequestStore
inherits Reference #

Stores the current HTTP::Request object.

Can be injected to access the request from a non controller context.

require "athena"

@[ADI::Register(public: true)]
class ExampleController < ART::Controller
  def initialize(@request_store : ART::RequestStore); end

  get "/" do
    @request_store.method
  end
end

ART.run

# GET / # => GET

Methods#

#request : HTTP::Request #

#request=(request : HTTP::Request) #

View source

#request? : HTTP::Request? #