We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This maybe a silly question. How do I deal with http basic auth?
Do I do something like this?
session.headers['username'] = 'abcd' session.headers['password'] = 'secret'
So far I am getting: #<Patron::Response @status_line='HTTP/1.1 401 Unauthorized'>
#<Patron::Response @status_line='HTTP/1.1 401 Unauthorized'>
When I try to browse using the browser the user name and password is valid.
For example:
Rest Client
RestClient.post 'https://example.com/token/grant', {"app_key":"my_app_key","app_secret":"my_app_secret"}.to_json, {username: 'username', password: 'password', content_type: 'application/json'}
Curb
require 'curb' request_path= 'https://example.com/token/grant' payload = { app_key: 'app_key', app_secret: 'app_secret' } http = Curl.post(request_path, payload.to_json) do |http| http.headers['username'] = 'user_name' http.headers['password'] = 'password' http.headers['Content-Type'] = 'application/json' end JSON.parse(http.body_str)
The text was updated successfully, but these errors were encountered:
Got it its
session.username = 'abcd' session.password = 'secret'
the document needs to be better
Sorry, something went wrong.
I would be happy to merge a PR that improves the documentation.
No branches or pull requests
This maybe a silly question.
How do I deal with http basic auth?
Do I do something like this?
So far I am getting:
#<Patron::Response @status_line='HTTP/1.1 401 Unauthorized'>
When I try to browse using the browser the user name and password is valid.
For example:
Rest Client
Curb
The text was updated successfully, but these errors were encountered: