Class: Async::HTTP::Protocol::HTTP2::Request
- Defined in:
- lib/async/http/protocol/http2.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Attributes inherited from Request
#authority, #body, #headers, #method, #path, #version
Instance Method Summary collapse
- #assign_headers(headers) ⇒ Object
- #hijack? ⇒ Boolean
-
#initialize(stream) ⇒ Request
constructor
A new instance of Request.
Methods inherited from Request
[], #connect?, #head?, #idempotent?, #to_s
Methods included from Body::Buffered::Reader
Constructor Details
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
132 133 134 |
# File 'lib/async/http/protocol/http2.rb', line 132 def stream @stream end |
Instance Method Details
#assign_headers(headers) ⇒ Object
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/async/http/protocol/http2.rb', line 134 def assign_headers(headers) headers.each do |key, value| if key == METHOD raise BadRequest, "Request method already specified" if @method @method = value elsif key == PATH raise BadRequest, "Request path already specified" if @path @path = value elsif key == AUTHORITY raise BadRequest, "Request authority already specified" if @authority @authority = value else @headers[key] = value end end end |
#hijack? ⇒ Boolean
154 155 156 |
# File 'lib/async/http/protocol/http2.rb', line 154 def hijack? false end |