Module: Legion::Extensions::Rfp::Ingest::Helpers::Client
- Included in:
- Client, Runners::Corpus, Runners::Documents, Runners::Parser
- Defined in:
- lib/legion/extensions/rfp/ingest/helpers/client.rb
Instance Method Summary collapse
Instance Method Details
#client(base_url: 'http://localhost:4567', token: nil) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/legion/extensions/rfp/ingest/helpers/client.rb', line 11 def client(base_url: 'http://localhost:4567', token: nil, **) Faraday.new(url: base_url) do |conn| conn.request :json conn.response :json, content_type: /\bjson$/ conn.headers['Content-Type'] = 'application/json' conn.headers['Authorization'] = "Bearer #{token}" if token end end |