Skip to content
Advertisement

GET Access token from API (oauth2)

I am very beginner at Python scripting and i have a problem.

I am trying to rewrite PHP code to Python to get Access token from API for further use.

JavaScript

This is what i am trying to do in Python.

My Python code is:

JavaScript

but this is not working

Python is returning:

JavaScript

I know that i am missing everything from the context variable from PHP Code. Do you know if there is a python method to create context like stream_context_create in PHP or maybe could you give me some tips how can i do it?

Advertisement

Answer

I managed to solve my problem. This is the code:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement