Class: Grape::Request

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/grape/request.rb

Constant Summary collapse

HTTP_PREFIX =
'HTTP_'

Instance Method Summary collapse

Constructor Details

#initialize(env, **options) ⇒ Request

Returns a new instance of Request.



9
10
11
12
# File 'lib/grape/request.rb', line 9

def initialize(env, **options)
  extend options[:build_params_with] || Grape.config.param_builder
  super(env)
end

Instance Method Details

#headersObject



22
23
24
# File 'lib/grape/request.rb', line 22

def headers
  @headers ||= build_headers
end

#paramsObject



14
15
16
17
18
19
20
# File 'lib/grape/request.rb', line 14

def params
  @params ||= build_params
rescue EOFError
  raise Grape::Exceptions::EmptyMessageBody.new(content_type)
rescue Rack::Multipart::MultipartPartLimitError
  raise Grape::Exceptions::TooManyMultipartFiles.new(Rack::Utils.multipart_part_limit)
end

#rack_paramsObject



7
# File 'lib/grape/request.rb', line 7

alias rack_params params