class Athena::Routing::RequestStore

Overview

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

Defined in:

request_store.cr

Instance Method Summary

Instance Method Detail

def request : HTTP::Request #

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

[View source]
def request? : HTTP::Request | Nil #