Class: PuppeteerEntity::Base
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- PuppeteerEntity::Base
- Defined in:
- lib/puppeteer_entity/base.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#response ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/puppeteer_entity/base.rb', line 14 def response url = url_with_query_params json = as_body_json retries = 0 begin HTTP.headers(response_headers) .post(url, json:) .tap do |res| raise RequestError.new(res.body.to_s) unless res.status.success? rescue RequestError => e retries = retries + 1 retries > retry_limit ? raise(e) : retry end end end |