Class: SAPOCI::Connect::Middleware::BackgroundSearch
- Inherits:
-
FaradayMiddleware::ResponseMiddleware
- Object
- FaradayMiddleware::ResponseMiddleware
- SAPOCI::Connect::Middleware::BackgroundSearch
- Defined in:
- lib/sapoci/connect/middleware/background_search.rb
Overview
BackgroundSearch is a Faraday response middleware that parses the response body into a SAPOCI::Document.
If you want Faraday to preserve the original HTTP response body, pass ‘preserve_raw: true` to the parser.
Example:
conn = Faraday.new("http://onlineshop.com/path", params: {"token" => "123"}) do |builder|
builder.use SAPOCI::Connect::Middleware::FollowRedirects, {cookies: :all, limit: 5}
builder.use SAPOCI::Connect::Middleware::BackgroundSearch, {preserve_raw: true}
builder.adapter :net_http
end