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(uri, options = {}) ⇒ Object
- #get(uri, options = {}) ⇒ Object
- #head(uri, options = {}) ⇒ Object
-
#initialize(access_key, secret_key, host) ⇒ Http
constructor
A new instance of Http.
- #options(uri, options = {}) ⇒ Object
- #post(uri, options = {}) ⇒ Object
- #put(uri, options = {}) ⇒ Object
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_key ⇒ Object (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_key ⇒ Object (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, = {}) headers = default_content_type.merge([:headers] || {}) request('DELETE', uri, .merge(headers: headers)) end |
#get(uri, options = {}) ⇒ Object
15 16 17 |
# File 'lib/aliyun/oss/http.rb', line 15 def get(uri, = {}) request('GET', uri, ) end |
#head(uri, options = {}) ⇒ Object
38 39 40 |
# File 'lib/aliyun/oss/http.rb', line 38 def head(uri, = {}) request('HEAD', uri, ) end |
#options(uri, options = {}) ⇒ Object
34 35 36 |
# File 'lib/aliyun/oss/http.rb', line 34 def (uri, = {}) request('OPTIONS', uri, ) end |
#post(uri, options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/aliyun/oss/http.rb', line 24 def post(uri, = {}) headers = default_content_type.merge([:headers] || {}) request('POST', uri, .merge(headers: headers)) end |
#put(uri, options = {}) ⇒ Object
19 20 21 22 |
# File 'lib/aliyun/oss/http.rb', line 19 def put(uri, = {}) headers = default_content_type.merge([:headers] || {}) request('PUT', uri, .merge(headers: headers)) end |