Class: TingYun::Http::HttpClientRequest
Constant Summary
AbstractRequest::ERROR_MESSAGE
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(proxy, *args, &block) ⇒ HttpClientRequest
Returns a new instance of HttpClientRequest.
7
8
9
10
11
|
# File 'lib/ting_yun/http/http_client_request.rb', line 7
def initialize(proxy, *args, &block)
@method, @uri, @query, @body, @header = args
@proxy = proxy
@block = block
end
|
Instance Attribute Details
Returns the value of attribute header.
5
6
7
|
# File 'lib/ting_yun/http/http_client_request.rb', line 5
def
@header
end
|
#method ⇒ Object
Returns the value of attribute method.
5
6
7
|
# File 'lib/ting_yun/http/http_client_request.rb', line 5
def method
@method
end
|
Instance Method Details
#[](key) ⇒ Object
21
22
23
|
# File 'lib/ting_yun/http/http_client_request.rb', line 21
def [](key)
@header[key]
end
|
#[]=(key, value) ⇒ Object
25
26
27
|
# File 'lib/ting_yun/http/http_client_request.rb', line 25
def []=(key, value)
@header[key] = value
end
|
#args ⇒ Object
34
35
36
|
# File 'lib/ting_yun/http/http_client_request.rb', line 34
def args
return @method, @uri, @query, @body, @header
end
|
#from ⇒ Object
17
18
19
|
# File 'lib/ting_yun/http/http_client_request.rb', line 17
def from
"http_client%2Fhttp"
end
|
#type ⇒ Object
13
14
15
|
# File 'lib/ting_yun/http/http_client_request.rb', line 13
def type
'HTTPClient'
end
|
#uri ⇒ Object
29
30
31
32
|
# File 'lib/ting_yun/http/http_client_request.rb', line 29
def uri
return @uri if @uri.scheme && @uri.host && @uri.port
URI("#{@proxy.scheme.downcase}://#{@proxy.host}:#{@proxy.port}#{@uri}")
end
|