def check_req(uri, headers, body):
    'Add access_token to the URL Request.'
    if (('access_token' not in uri) and session.get('access_token')):
        params = {'access_token': session.get('access_token')[0]}
        url_parts = list(urllib.parse.urlparse(uri))
        query = dict(urllib.parse.parse_qsl(url_parts[4]))
        query.update(params)
        url_parts[4] = urllib.parse.urlencode(query)
        uri = urllib.parse.urlunparse(url_parts)
    return (uri, headers, body)
Add access_token to the URL Request.
def check_req(uri, headers, body):
    
    if (('access_token' not in uri) and session.get('access_token')):
        params = {'access_token': session.get('access_token')[0]}
        url_parts = list(urllib.parse.urlparse(uri))
        query = dict(urllib.parse.parse_qsl(url_parts[4]))
        query.update(params)
        url_parts[4] = urllib.parse.urlencode(query)
        uri = urllib.parse.urlunparse(url_parts)
    return (uri, headers, body)