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.
6 7 8 9 10 |
# File 'lib/aliyun/oss/http.rb', line 6 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.
4 5 6 |
# File 'lib/aliyun/oss/http.rb', line 4 def access_key @access_key end |
#secret_key ⇒ Object (readonly)
Returns the value of attribute secret_key.
4 5 6 |
# File 'lib/aliyun/oss/http.rb', line 4 def secret_key @secret_key end |
Instance Method Details
#delete(uri, options = {}) ⇒ Object
26 27 28 29 |
# File 'lib/aliyun/oss/http.rb', line 26 def delete(uri, = {}) headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }.merge([:headers] || {}) request('DELETE', uri, .merge(headers: headers)) end |
#get(uri, options = {}) ⇒ Object
12 13 14 |
# File 'lib/aliyun/oss/http.rb', line 12 def get(uri, = {}) request('GET', uri, ) end |
#head(uri, options = {}) ⇒ Object
35 36 37 |
# File 'lib/aliyun/oss/http.rb', line 35 def head(uri, = {}) request('HEAD', uri, ) end |
#options(uri, options = {}) ⇒ Object
31 32 33 |
# File 'lib/aliyun/oss/http.rb', line 31 def (uri, = {}) request('OPTIONS', uri, ) end |
#post(uri, options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/aliyun/oss/http.rb', line 21 def post(uri, = {}) headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }.merge([:headers] || {}) request('POST', uri, .merge(headers: headers)) end |
#put(uri, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/aliyun/oss/http.rb', line 16 def put(uri, = {}) headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }.merge([:headers] || {}) request('PUT', uri, .merge(headers: headers)) end |