Class: UU::OS::HTTP::HTTPPost
- Inherits:
-
HTTPMethod
- Object
- HTTPMethod
- UU::OS::HTTP::HTTPPost
- Defined in:
- uu_os_connection-2.2.4/lib/uu/os/http/http_post.rb
Overview
POST Method.
Instance Attribute Summary
Attributes inherited from HTTPMethod
#headers, #method, #parameters, #path
Instance Method Summary (collapse)
-
- (HTTPMethod) accept(*content_type)
Sets custom Accept header.
-
- (HTTPPost) content_type(content_type)
Defines content-type to be used for payload.
-
- (UU::OS::HTTP::HTTPResponse) execute(payload = nil)
Executes method sending given payload.
-
- (UU::OS::HTTP::HTTPResponse) execute_async(payload = nil)
Executes method sending given payload asynchronously.
Methods inherited from HTTPMethod
Instance Method Details
- (HTTPMethod) accept(*content_type)
Sets custom Accept header.
24 25 26 27 |
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_post.rb', line 24 def accept(*content_type) headers[:accept] = content_type return self end |
- (HTTPPost) content_type(content_type)
Defines content-type to be used for payload.
32 33 34 35 |
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_post.rb', line 32 def content_type(content_type) headers[:content_type] = content_type return self end |
- (UU::OS::HTTP::HTTPResponse) execute(payload = nil)
Executes method sending given payload. In case you need to stream response or upload large data, execute_async should be used.
42 43 44 |
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_post.rb', line 42 def execute(payload = nil) super(process_payload(payload)) end |
- (UU::OS::HTTP::HTTPResponse) execute_async(payload = nil)
Executes method sending given payload asynchronously. Unlike execute, this call is non blocking.
50 51 52 |
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_post.rb', line 50 def execute_async(payload = nil) super(process_payload(payload)) end |