Module: HttpUtilities::Http::Post
- Included in:
- Client
- Defined in:
- lib/http_utilities/http/post.rb
Instance Method Summary collapse
- #post_and_retrieve_content(url, data, options = {}) ⇒ Object
- #post_and_retrieve_parsed_html(url, data, options = {}) ⇒ Object
- #post_and_retrieve_parsed_xml(url, data, options = {}) ⇒ Object
Instance Method Details
#post_and_retrieve_content(url, data, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/http_utilities/http/post.rb', line 15 def post_and_retrieve_content(url, data, = {}) response = nil method = [:method] || :net_http response_only = .delete(:response_only) { |e| true } if (method.eql?(:net_http)) response = post_and_retrieve_content_using_net_http(url, data, ) elsif (method.eql?(:curl)) response = post_and_retrieve_content_using_curl(url, data, ) end return response end |
#post_and_retrieve_parsed_html(url, data, options = {}) ⇒ Object
5 6 7 8 |
# File 'lib/http_utilities/http/post.rb', line 5 def post_and_retrieve_parsed_html(url, data, = {}) .merge!({:force_encoding => true, :format => :html}) return post_and_retrieve_content(url, data, ) end |
#post_and_retrieve_parsed_xml(url, data, options = {}) ⇒ Object
10 11 12 13 |
# File 'lib/http_utilities/http/post.rb', line 10 def post_and_retrieve_parsed_xml(url, data, = {}) .merge!({:force_encoding => true, :format => :xml}) return post_and_retrieve_content(url, data, ) end |