Class: Html2rss::RequestService::FaradayStrategy
- Defined in:
- lib/html2rss/request_service/faraday_strategy.rb
Overview
Strategy to use Faraday for the request.
Instance Method Summary collapse
-
#execute ⇒ Object
return [Response].
Methods inherited from Strategy
Constructor Details
This class inherits a constructor from Html2rss::RequestService::Strategy
Instance Method Details
#execute ⇒ Object
return [Response]
13 14 15 16 17 18 19 20 21 |
# File 'lib/html2rss/request_service/faraday_strategy.rb', line 13 def execute request = Faraday.new(url: ctx.url, headers: ctx.headers) do |faraday| faraday.use Faraday::FollowRedirects::Middleware faraday.adapter Faraday.default_adapter end response = request.get Response.new(body: response.body, headers: response.headers) end |