Commit 290193d7 authored by Mikaël Salson's avatar Mikaël Salson refactor

extract IMGT specific part, to have a more generic function that could be used elsewhere
parent 19df7b47
......@@ -10,17 +10,20 @@ if request.env.http_origin:
def index():
return gluon.contrib.simplejson.dumps("index()")
def imgt():
def proxy_request(url, headers):
if request.env.request_method == "POST":
payload = dict(request.post_vars)
if 'Session' in payload.keys():
del payload['Session']
response ="", data=payload)
response =, headers = headers, data=payload)
if response.status_code ==
return response
return gluon.contrib.simplejson.dumps("the site returned an invalid response")
return gluon.contrib.simplejson.dumps("improper method")
def imgt():
return proxy_request("")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment