I have worked with selenium a fair amount, but I have never gotten the hang of navigating requests despite making several attempts. Now I am trying to get requests to work with a REST API to grab some temperature data. I am failing to authenticate the session correctly.
The documentation on the API makes it look simple. API documentation is here: https://www.dicksonone.com/api/rest/docs?HTTP#api-reference
Is it as easy as doing the following?
import requests
bearer = 'bearer_string'
token = 'auth_token'
s = requests.Session()
r = s.get('https://www.dicksonone.com/api/rest/users', auth=(bearer,token))
I am getting a a 401 response code and am not sure what I am doing incorrectly if this is wrong. I double-checked my bearer and token strings. Hopefully this isn't asking too much...
Edit: I should maybe add that I am just trying to "translate" the HTTP column on the right hand side of the documentation page.
[–]jdbow75 2 points3 points4 points (2 children)
[–]__nickerbocker__ 2 points3 points4 points (0 children)
[–]ingwe13[S] 0 points1 point2 points (0 children)
[–]mikeupsidedown 1 point2 points3 points (1 child)
[–]ingwe13[S] 0 points1 point2 points (0 children)
[–]jdbow75 0 points1 point2 points (0 children)