Response 401 when trying to access rest api
-
I am writing a python script to work with the wordpress rest api, and I am using the oauth server for this. I am using the authorization code grant type. I am successfully getting the access token from the server, but when I try to submit a request to the api, I am getting a 401 response.
I have uploaded screenshots here: https://imgur.com/a/XkNUaDJ
I am using the python requests-oauthlib library to authenticate and send the request. As you can see, I am successfully getting the access token, and also including the access token in the header. I contacted my hosting service in case it was a security feature on their end, and they said there was something wrong with the plugin, as you can see in the second picture. I am pretty sure there is nothing wrong with my code, as its basically what you see in the documentation for the python library: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#web-application-flow.
Can you tell me what is wrong or how to debug this?
- The topic ‘Response 401 when trying to access rest api’ is closed to new replies.