-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use webdav verbs #1532
Comments
Hi @sdalu, that shouldn't be the case, res = Faraday.new.run_request(:copy, 'http://httpbingo.org', nil, {})
res.headers # check headers to ensure the request happened
# => {"access-control-allow-credentials"=>"true",
# "access-control-allow-origin"=>"*",
# "content-type"=>"text/plain; charset=utf-8",
# "x-content-type-options"=>"nosniff",
# "date"=>"Tue, 14 Nov 2023 09:38:44 GMT",
# "content-encoding"=>"gzip",
# "transfer-encoding"=>"chunked",
# "server"=>"Fly/442f90d3 (2023-11-07)",
# "via"=>"1.1 fly.io",
# "fly-request-id"=>"01HF6K53ZP9SERP27MBTT8G93K-lhr",
# "cf-team"=>"1c6ecba7e0000048c3fb9f3400000001"}
res.body # we even got a response from httpbingo
# => "method COPY not allowed\n" Could you please share more details around what you're trying and what error you're getting from Faraday, exactly? |
On 2.7.11 as well: require 'faraday'
f = Faraday.new(url: 'http://httpbingo.org') do |f|
end
f.run_request(:proppatch, "/foo", nil, {})
|
You're right, I was messing with
Faraday::Connection::METHODS.merge([:copy, :lock, :mkcol, :move, :propfind, :proppatch, :unlock]) After that, you'll be able to use I appreciate you were probably looking to make them first-class citizens like the others, and potentially make them methods like If you'd like to see that happening, then my suggestion would be to instead build an extension gem ( I'm closing this issue because of the problem described being "solved" with the hack, but if you're interested in the extension idea and would like discussing it more, then I'd encourage you to open a discussion instead 🙌 ! |
Connection#run_request
checks for verb inConnection::METHODS
.Unfortunetaly
Connection::METHODS
is defined adSet.new %i[get post put delete head patch options trace]
which doesn't allowsPROPFIND
,PROPPATCH
,MKCOL
,COPY
, ...The text was updated successfully, but these errors were encountered: