module Grape::DSL::Headers
Public Instance Methods
Source
# File lib/grape/dsl/headers.rb, line 11 def header(key = nil, val = nil) if key val ? header[key] = val : header.delete(key) else @header ||= Grape::Util::Header.new end end
This method has four responsibilities:
-
Set a specifc header value by key
-
Retrieve a specifc header value by key
-
Retrieve all headers that have been set
-
Delete a specifc header key-value pair
Also aliased as: headers