Module: Experian::HTTP
- Included in:
- Client
- Defined in:
- lib/experian/http.rb
Defined Under Namespace
Modules: FlatParamsEncoder
Instance Method Summary collapse
Instance Method Details
#get(path:, format:, **query) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/experian/http.rb', line 71 def get(path:, format:, **query) tip_formato = { xml: 2, pdf: 3 }[format] raise Experian::Error, "Invalid format: #{format}" unless tip_formato query.merge!(tip_formato:) full_uri = uri(path:, query:) if format == :xml return conn.get(full_uri) do |req| req.headers = headers end end full_uri end |