module Ethon::Easy::Http
def fabricate(url, action_name, options)
-
(Easy::Ethon::Actionable)- The request instance.
Parameters:
-
options(Hash) -- The option hash. -
action_name(String) -- The HTTP action name. -
url(String) -- The url.
Other tags:
- Example: Return the action. -
def fabricate(url, action_name, options) constant_name = action_name.to_s.capitalize if Ethon::Easy::Http.const_defined?(constant_name) Ethon::Easy::Http.const_get(constant_name).new(url, options) else Ethon::Easy::Http::Custom.new(constant_name.upcase, url, options) end end
def http_request(url, action_name, options = {})
- See: Ethon::Easy::Options -
Returns:
-
(void)-
Options Hash:
(**options)-
:headers(Hash) -- Request headers. -
:body(Hash) -- Body hash which -
:params(Hash) -- Params hash which
Parameters:
-
options(Hash) -- The options hash. -
action_name(String) -- The HTTP action name. -
url(String) -- The url.
Other tags:
- Example: Set options for HTTP request. -
def http_request(url, action_name, options = {}) fabricate(url, action_name, options).setup(self) end