Class: Inspec::Resources::Http
- Inherits:
-
Object
- Object
- Inspec::Resources::Http
- Defined in:
- lib/resources/http.rb
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(url, method: 'GET', params: nil, auth: {}, headers: {}, data: nil) ⇒ Http
constructor
rubocop:disable ParameterLists.
- #status ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(url, method: 'GET', params: nil, auth: {}, headers: {}, data: nil) ⇒ Http
rubocop:disable ParameterLists
27 28 29 30 31 32 33 34 |
# File 'lib/resources/http.rb', line 27 def initialize(url, method: 'GET', params: nil, auth: {}, headers: {}, data: nil) @url = url @method = method @params = params @auth = auth @headers = headers @data = data end |
Instance Method Details
#body ⇒ Object
40 41 42 |
# File 'lib/resources/http.rb', line 40 def body response.to_s end |
#headers ⇒ Object
44 45 46 |
# File 'lib/resources/http.rb', line 44 def headers Hashie::Mash.new(response.headers.to_h) end |
#status ⇒ Object
36 37 38 |
# File 'lib/resources/http.rb', line 36 def status response.status end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/resources/http.rb', line 48 def to_s "http #{@method} on #{@url}" end |