Class: SpecForge::HTTP::Client
- Inherits:
-
Object
- Object
- SpecForge::HTTP::Client
- Defined in:
- lib/spec_forge/http/client.rb
Overview
High-level HTTP client for executing requests
Client wraps Backend and provides a simple interface for executing HTTP::Request objects and returning responses.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
Creates a new HTTP client with a backend.
-
#perform(request) ⇒ Faraday::Response
Executes an HTTP request and returns the response.
Constructor Details
Instance Method Details
#perform(request) ⇒ Faraday::Response
Executes an HTTP request and returns the response
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/spec_forge/http/client.rb', line 28 def perform(request) @backend.public_send( request.http_verb.downcase, base_url: request.base_url, url: request.url.delete_prefix("/"), headers: request.headers, query: request.query, body: request.body ) end |