Closed uday708 closed 1 year ago
Hi @uday708, sorry you're having this issue. Unfortunately we don't have any expertise with JRuby, but let me see if I can help. The error itself and the stack trace are not very helpful, would you be able to share the portion of your code that is causing this issue? Are you initialising a new faraday connection, or running a request?
Hi @iMacTia
It is coming when I am triggering Faraday::Env.from(e.response)
this code e.response is:
{
:status => 404,
:headers => {},
:body => "{}",
:request => {
:method => :post,
:url_path => "/xyz",
:params => nil,
:headers => {
"User-Agent" => "xyz",
"Content-Type" => "xyz"
},
:body=>"xyz"
}
}
Thank you @uday708, that explains why then!
The payload you shared above is not a valid Faraday::Env
hash.
Here is the definition for this Struct: https://github.com/lostisland/faraday/blob/main/lib/faraday/options/env.rb#L57
As you can see, method
should be in the root rather than under request
.
And that's not the only issue, there are others (e.g. url_path
doesn't exist).
Where are you getting this e.response
and why are you manually trying to create a Faraday::Env
from it?
This shouldn't normally be necessary when using Faraday
Thanks @iMacTia I have figured out by removing request
key from hash
Awesome! Thank you for confirming 🙏
Basic Info
Issue description
I am facing issue
Trail