Class: Aliyun::Odps::Http

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/aliyun/odps/http.rb

Overview

nodoc

Defined Under Namespace

Classes: BetterXmlParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Http

Returns a new instance of Http.



23
24
25
# File 'lib/aliyun/odps/http.rb', line 23

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



21
22
23
# File 'lib/aliyun/odps/http.rb', line 21

def config
  @config
end

Instance Method Details

#delete(uri, options = {}) ⇒ Object



41
42
43
44
# File 'lib/aliyun/odps/http.rb', line 41

def delete(uri, options = {})
  headers = default_content_type.merge(options[:headers] || {})
  request('DELETE', uri, options.merge(headers: headers))
end

#get(uri, options = {}) ⇒ Object



27
28
29
# File 'lib/aliyun/odps/http.rb', line 27

def get(uri, options = {})
  request('GET', uri, options)
end

#head(uri, options = {}) ⇒ Object



50
51
52
# File 'lib/aliyun/odps/http.rb', line 50

def head(uri, options = {})
  request('HEAD', uri, options)
end

#options(uri, options = {}) ⇒ Object



46
47
48
# File 'lib/aliyun/odps/http.rb', line 46

def options(uri, options = {})
  request('OPTIONS', uri, options)
end

#post(uri, options = {}) ⇒ Object



36
37
38
39
# File 'lib/aliyun/odps/http.rb', line 36

def post(uri, options = {})
  headers = default_content_type.merge(options[:headers] || {})
  request('POST', uri, options.merge(headers: headers))
end

#put(uri, options = {}) ⇒ Object



31
32
33
34
# File 'lib/aliyun/odps/http.rb', line 31

def put(uri, options = {})
  headers = default_content_type.merge(options[:headers] || {})
  request('PUT', uri, options.merge(headers: headers))
end