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.



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

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.



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

def access_key
  @access_key
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



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

def secret_key
  @secret_key
end

Instance Method Details

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



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

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

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



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

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

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



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

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

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



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

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

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



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

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

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



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

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