[ Server for testing OAuth2 callback ]
I need to run an HTTP Server in Python to handle a callback from a website which uses OAuth2. I did some search and found that
BaseHTTPServer is what I was looking for.
Which one should I use to only receive a code from a
GET callback? So I just want the code to remain simple.
The simplest working example I found is in this project:
In particular: example/server.py
If you are using BaseHTTPRequestHandler and that is the only thing your server is handling your class might be as simple as:
from urlparse import urlparse,parse_qsl
url = urlparse(self.path)
code = parse_qsl(url.query)['code']