Class: Aliyun::Oss::Http
- Inherits:
-
Object
- Object
- Aliyun::Oss::Http
- Defined in:
- lib/aliyun/oss/http.rb
Overview
nodoc
Instance Attribute Summary collapse
-
#access_key ⇒ Object
readonly
Returns the value of attribute access_key.
-
#secret_key ⇒ Object
readonly
Returns the value of attribute secret_key.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
- #head(path, options = {}) ⇒ Object
-
#initialize(access_key, secret_key, host) ⇒ Http
constructor
A new instance of Http.
- #options(path, options = {}) ⇒ Object
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
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_key ⇒ Object (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_key ⇒ Object (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, = {}) headers = default_content_type.merge([:headers] || {}) request('DELETE', path, .merge(headers: headers)) end |
#get(path, options = {}) ⇒ Object
16 17 18 |
# File 'lib/aliyun/oss/http.rb', line 16 def get(path, = {}) request('GET', path, ) end |
#head(path, options = {}) ⇒ Object
39 40 41 |
# File 'lib/aliyun/oss/http.rb', line 39 def head(path, = {}) request('HEAD', path, ) end |
#options(path, options = {}) ⇒ Object
35 36 37 |
# File 'lib/aliyun/oss/http.rb', line 35 def (path, = {}) request('OPTIONS', path, ) end |
#post(path, options = {}) ⇒ Object
25 26 27 28 |
# File 'lib/aliyun/oss/http.rb', line 25 def post(path, = {}) headers = default_content_type.merge([:headers] || {}) request('POST', path, .merge(headers: headers)) end |
#put(path, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/aliyun/oss/http.rb', line 20 def put(path, = {}) headers = default_content_type.merge([:headers] || {}) request('PUT', path, .merge(headers: headers)) end |