lib/hackerone/client/resource_helper.rb in hackerone-client-0.11.0 vs lib/hackerone/client/resource_helper.rb in hackerone-client-0.12.0
- old
+ new
@@ -3,31 +3,34 @@
module ResourceHelper
def self.included(base)
base.extend(self)
end
- def parse_response(response)
- HackerOne::Client::Api.parse_response(response)
+ def parse_response(response, extract_data: true)
+ HackerOne::Client::Api.parse_response(
+ response,
+ extract_data: extract_data
+ )
end
- def make_post_request(url, request_body:)
+ def make_post_request(url, request_body:, extract_data: true)
response = HackerOne::Client::Api.hackerone_api_connection.post do |req|
req.headers['Content-Type'] = 'application/json'
req.url url
req.body = { data: request_body }.to_json
end
- parse_response(response)
+ parse_response(response, extract_data: extract_data)
end
- def make_get_request(url, params: {})
+ def make_get_request(url, params: {}, extract_data: true)
response = HackerOne::Client::Api.hackerone_api_connection.get do |req|
req.headers['Content-Type'] = 'application/json'
req.url url
req.params = params
end
- parse_response(response)
+ parse_response(response, extract_data: extract_data)
end
private
def api_connection