Class: Aliyun::Oss::Http

Inherits:
Object
  • Object
show all
Defined in:
lib/aliyun/oss/http.rb

Overview

nodoc

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_key, secret_key, host) ⇒ Http

Returns a new instance of Http.



10
11
12
13
14
# File 'lib/aliyun/oss/http.rb', line 10

def initialize(access_key, secret_key, host)
  @access_key = access_key
  @secret_key = secret_key
  @host = host
end

Instance Attribute Details

#access_keyObject (readonly)

Returns the value of attribute access_key.



8
9
10
# File 'lib/aliyun/oss/http.rb', line 8

def access_key
  @access_key
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



8
9
10
# File 'lib/aliyun/oss/http.rb', line 8

def secret_key
  @secret_key
end

Instance Method Details

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



30
31
32
33
# File 'lib/aliyun/oss/http.rb', line 30

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

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



16
17
18
# File 'lib/aliyun/oss/http.rb', line 16

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

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



39
40
41
# File 'lib/aliyun/oss/http.rb', line 39

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

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



35
36
37
# File 'lib/aliyun/oss/http.rb', line 35

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

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



25
26
27
28
# File 'lib/aliyun/oss/http.rb', line 25

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

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



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

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