-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: use POST method for token request #11
Conversation
88bfc21
to
675d3ae
Compare
7eb9902
to
c07f413
Compare
lib/panda.rb
Outdated
connection = Faraday.new do |conn| | ||
conn.use Panda::ErrorMiddleware | ||
conn.request :json | ||
conn.response :json | ||
end | ||
|
||
response = connection.get(request.url, request.params, request.headers) | ||
response = do_request(connection, request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use connection.run_request(request.method, request.url, request.body, request.headers)
, it's more flexible in case we will need to add more HTTP methods
c07f413
to
e79c5ea
Compare
lib/panda.rb
Outdated
Panda::HTTPResponse.new(response.status, response.headers, response.body) | ||
end | ||
|
||
def do_request(connection, request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this method?
e79c5ea
to
50cb98d
Compare
It happened that token info get request uses POST method. This PR fixes method mismatch