Class: Java::OrgApacheHttpClientMethods::HttpRequestBase
- Inherits:
-
Object
- Object
- Java::OrgApacheHttpClientMethods::HttpRequestBase
- Defined in:
- lib/manticore/java_extensions.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
Get a single request header.
-
#[]=(key, val) ⇒ Object
Set a single request header.
-
#headers ⇒ Object
Provides an easy way to get the request headers from any request.
Instance Method Details
#[](key) ⇒ Object
Get a single request header
11 12 13 14 |
# File 'lib/manticore/java_extensions.rb', line 11 def [](key) h = get_last_header(key) h && h.value || nil end |
#[]=(key, val) ⇒ Object
Set a single request header
17 18 19 |
# File 'lib/manticore/java_extensions.rb', line 17 def []=(key, val) set_header key, val end |
#headers ⇒ Object
Provides an easy way to get the request headers from any request
6 7 8 |
# File 'lib/manticore/java_extensions.rb', line 6 def headers Hash[*get_all_headers.flat_map { |h| [h.name, h.value] }] end |