conn = Faraday.new(url: "https://example.com/something") do |faraday|
faraday.adapter :net_http
faraday.request :basic_authentication
end
RuntimeError: :basic_authentication is not registered on Faraday::Request
from /Users/dukejones/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/faraday-0.8.7/lib/faraday.rb:64:in `lookup_middleware'
This was working great at 3 in the morning. At 4am it stopped working. I didn't update the gem, not sure what I changed. I see Faraday::Request::BasicAuthentication in the source tree. In fact, the same thing happens with:
conn = Faraday.new(url: "https://example.com/something") do |faraday|
faraday.adapter :net_http
faraday.request Faraday::Request::BasicAuthentication
end
It works fine with Faraday::Request::Authorization.
conn = Faraday.new(url: "https://example.com/something") do |faraday|
faraday.adapter :net_http
faraday.request :authorization
end
Any ideas?
In the meantime I'll manually Base64 encode my token, but I'd really like to know what's going wrong here.
What version of Faraday? Pretty sure the key name is :basic_auth, not :basic_authorization.
https://github.com/lostisland/faraday/blob/v0.8.7/lib/faraday/request.rb#L30
Most helpful comment
What version of Faraday?Pretty sure the key name is:basic_auth, not:basic_authorization.https://github.com/lostisland/faraday/blob/v0.8.7/lib/faraday/request.rb#L30