Class: Savon::Transport::Faraday
- Inherits:
-
Object
- Object
- Savon::Transport::Faraday
- Includes:
- Logging
- Defined in:
- lib/savon/transport/faraday.rb
Overview
Faraday-backed HTTP transport for the opt-in Faraday path.
Encapsulates everything Faraday-specific:
* header assembly (SOAP + global + local + cookies + Content-Length)
* request execution via the caller-configured Faraday::Connection
Transport-level concerns (SSL, auth, proxy, timeouts, middleware) are the caller's responsibility via client.faraday before any call is made.
Instance Method Summary collapse
-
#initialize(connection, globals) ⇒ Faraday
constructor
A new instance of Faraday.
-
#post(url, soap_headers, body, locals) ⇒ Transport::Response
Assembles headers, executes the POST via the Faraday connection, and returns a Transport::Response.
Constructor Details
#initialize(connection, globals) ⇒ Faraday
Returns a new instance of Faraday.
21 22 23 24 |
# File 'lib/savon/transport/faraday.rb', line 21 def initialize(connection, globals) @connection = connection @globals = globals end |
Instance Method Details
#post(url, soap_headers, body, locals) ⇒ Transport::Response
Assembles headers, executes the POST via the Faraday connection, and returns a Transport::Response. Logs the outbound request and inbound response when logging is enabled.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/savon/transport/faraday.rb', line 35 def post(url, soap_headers, body, locals) headers = build_headers(soap_headers, body, locals) log_request(url, headers, body) if log? faraday_response = @connection.post(url, body, headers) response = Response.from_faraday(faraday_response) log_response(response) if log? response end |