Class: JPush::NativeHttpClient
- Inherits:
-
Object
- Object
- JPush::NativeHttpClient
- Defined in:
- lib/jpush/http_client.rb
Instance Method Summary collapse
-
#initialize(maxRetryTimes = 5, opts = {}) ⇒ NativeHttpClient
constructor
A new instance of NativeHttpClient.
- #sendDelete(url, content) ⇒ Object
- #sendGet(url, content) ⇒ Object
- #sendPost(url, content) ⇒ Object
Constructor Details
#initialize(maxRetryTimes = 5, opts = {}) ⇒ NativeHttpClient
Returns a new instance of NativeHttpClient.
11 12 13 14 15 16 |
# File 'lib/jpush/http_client.rb', line 11 def initialize(maxRetryTimes = 5, opts = {}) @maxRetryTimes = maxRetryTimes @logger = Logger.new(STDOUT) @@proxy_addr = opts[:proxy_addr] @@proxy_port = opts[:proxy_port] end |
Instance Method Details
#sendDelete(url, content) ⇒ Object
26 27 28 |
# File 'lib/jpush/http_client.rb', line 26 def sendDelete(url, content) return sendRequest(url, content, 'DELETE') end |
#sendGet(url, content) ⇒ Object
22 23 24 |
# File 'lib/jpush/http_client.rb', line 22 def sendGet(url, content) return sendRequest(url, content, 'GET') end |
#sendPost(url, content) ⇒ Object
18 19 20 |
# File 'lib/jpush/http_client.rb', line 18 def sendPost(url, content) return sendRequest(url, content, 'POST') end |