Class: TencentCloud::Common::BaseRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/tencentcloud-sdk-common/http/request.rb

Overview

base class of http request data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheme = '', host = '', method = '', uri = '', header = {}, data = nil) ⇒ BaseRequest

Returns a new instance of BaseRequest.



49
50
51
52
53
54
55
56
57
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 49

def initialize(scheme = '', host = '', method = '', uri = '', header = {}, data = nil)
  @scheme = scheme
  @host = host
  @method = method
  @uri = uri
  @header = header
  @data = data
  @is_multipart = false
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def data
  @data
end

#headerObject

Returns the value of attribute header.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def header
  @header
end

#hostObject

Returns the value of attribute host.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def host
  @host
end

#is_multipartObject

Returns the value of attribute is_multipart.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def is_multipart
  @is_multipart
end

#methodObject

Returns the value of attribute method.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def method
  @method
end

#schemeObject

Returns the value of attribute scheme.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def scheme
  @scheme
end

#uriObject

Returns the value of attribute uri.



47
48
49
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 47

def uri
  @uri
end

Instance Method Details

#to_sObject



59
60
61
62
63
64
65
66
# File 'lib/tencentcloud-sdk-common/http/request.rb', line 59

def to_s
  s = "Host: #{@host}\nMethod: #{method}\nUri: #{@uri}\nHeader: \n"
  @header ||= {}
  @header.each do |k, v|
    s += "#{k}: #{v}\n"
  end
  s += "Data: #{@data}\n"
end