Class: WhatsappSdk::Api::Request
- Inherits:
-
Object
- Object
- WhatsappSdk::Api::Request
- Defined in:
- lib/whatsapp_sdk/api/request.rb
Direct Known Subclasses
Instance Method Summary collapse
- #download_file(url:, content_type_header:, file_path: nil) ⇒ Object
-
#initialize(client = WhatsappSdk.configuration.client) ⇒ Request
constructor
A new instance of Request.
- #send_request(endpoint: nil, full_url: nil, http_method: "post", params: {}, headers: {}, multipart: false) ⇒ Object
Constructor Details
#initialize(client = WhatsappSdk.configuration.client) ⇒ Request
Returns a new instance of Request.
9 10 11 |
# File 'lib/whatsapp_sdk/api/request.rb', line 9 def initialize(client = WhatsappSdk.configuration.client) @client = client end |
Instance Method Details
#download_file(url:, content_type_header:, file_path: nil) ⇒ Object
13 14 15 |
# File 'lib/whatsapp_sdk/api/request.rb', line 13 def download_file(url:, content_type_header:, file_path: nil) @client.download_file(url: url, content_type_header: content_type_header, file_path: file_path) end |
#send_request(endpoint: nil, full_url: nil, http_method: "post", params: {}, headers: {}, multipart: false) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/whatsapp_sdk/api/request.rb', line 17 def send_request(endpoint: nil, full_url: nil, http_method: "post", params: {}, headers: {}, multipart: false) @client.send_request( http_method: http_method, full_url: full_url, endpoint: endpoint, params: params, headers: headers, multipart: multipart ) end |