Faraday: TRACE and CONNECT verbs aren't supported

Created on 27 Jan 2015  ·  4Comments  ·  Source: lostisland/faraday

> Faraday.run_request(:trace, 'http://example.com', "", {})
ArgumentError: unknown http method: trace
> Faraday.run_request(:connect, 'http://example.com', "", {})
ArgumentError: unknown http method: connect

Both methods have fairly widespread support among Ruby HTTP clients, and TRACE is supported by Net::HTTP.

feature help wanted

All 4 comments

We accept PRs to add it to the list of supported methods, including tests that verify that the calls work across adapters https://github.com/lostisland/faraday/blob/458f319c0d6f3fc64f766d2383fa07b9f4ab991a/lib/faraday/connection.rb#L15

Adding in #861

861 is now merged so this can be closed

@technoweenie @iMacTia Is there an ETA when PR #861 will be available in a new release? I'm using InSpec which uses faraday as HTTP library and 0.15.4 was released 27th Nov 2018 and I'm afraid they'll wait until a new version of faraday is available that includes the missing HTTP methods.

inspec> http('https://www.example.org', method: 'TRACE').headers
ArgumentError: unknown http method: trace
from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/faraday-0.15.4/lib/faraday/connection.rb:373:in `run_request'

Thanks in advance and kind regards,
Seb

Was this page helpful?
0 / 5 - 0 ratings