Class: TingYun::Http::TyphoeusHTTPRequest
Constant Summary
collapse
- TYPHOEUS =
"Typhoeus".freeze
- LHOST =
'host'.freeze
- UHOST =
'Host'.freeze
- GET =
'GET'.freeze
AbstractRequest::ERROR_MESSAGE
Instance Method Summary
collapse
Constructor Details
Returns a new instance of TyphoeusHTTPRequest.
Instance Method Details
#[](key) ⇒ Object
72
73
74
75
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 72
def [](key)
return nil unless @request.options && @request.options[:headers]
@request.options[:headers][key]
end
|
#[]=(key, value) ⇒ Object
77
78
79
80
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 77
def []=(key, value)
@request.options[:headers] ||= {}
@request.options[:headers][key] = value
end
|
#from ⇒ Object
51
52
53
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 51
def from
"typhoeus%2Fhttp"
end
|
#host ⇒ Object
62
63
64
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 62
def host
|| @uri.host
end
|
58
59
60
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 58
def
self[LHOST] || self[UHOST]
end
|
#method ⇒ Object
68
69
70
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 68
def method
(@request.options[:method] || GET).to_s.upcase
end
|
#type ⇒ Object
48
49
50
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 48
def type
TYPHOEUS
end
|
#uri ⇒ Object
82
83
84
|
# File 'lib/ting_yun/http/typhoeus_wrappers.rb', line 82
def uri
@uri
end
|