Class: Msf::Auxiliary::Web::HTTP::Request
- Inherits:
-
Object
- Object
- Msf::Auxiliary::Web::HTTP::Request
- Defined in:
- lib/msf/core/auxiliary/web/http.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #handle_response(response) ⇒ Object
-
#initialize(url, opts = {}, &callback) ⇒ Request
constructor
A new instance of Request.
- #method ⇒ Object
Constructor Details
#initialize(url, opts = {}, &callback) ⇒ Request
Returns a new instance of Request.
19 20 21 22 23 24 25 26 |
# File 'lib/msf/core/auxiliary/web/http.rb', line 19 def initialize( url, opts = {}, &callback ) @url = url.to_s.dup @opts = opts.dup @opts[:method] ||= :get @callbacks = [callback].compact end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
17 18 19 |
# File 'lib/msf/core/auxiliary/web/http.rb', line 17 def callbacks @callbacks end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
16 17 18 |
# File 'lib/msf/core/auxiliary/web/http.rb', line 16 def opts @opts end |
#url ⇒ Object
Returns the value of attribute url.
15 16 17 |
# File 'lib/msf/core/auxiliary/web/http.rb', line 15 def url @url end |
Instance Method Details
#handle_response(response) ⇒ Object
32 33 34 |
# File 'lib/msf/core/auxiliary/web/http.rb', line 32 def handle_response( response ) callbacks.each { |c| c.call response } end |
#method ⇒ Object
28 29 30 |
# File 'lib/msf/core/auxiliary/web/http.rb', line 28 def method opts[:method] end |