ok, so after a week of zero success trying everything i can think of, i 
decided to try using the requests method instead of the above urllib2 
method.  it worked like a charm and it was less complicated code.  i 
replicated the above method but in requests as shown below.  requests is 
probably doing more blackbox stuff to get that XMLHttpRequest thing to 
work, but it totally returned a code of 200 and the proper json record as 
in the firefox tracing.  just documenting for others...

    #part 1
    #establish connection and session cookie...    
    s = requests.Session()
    qh = { }
    qh['Host'] = "core.duvalclerk.com"
    qh['User-Agent'] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; 
rv:45.0) Gecko/20100101 Firefox/45.0"
    qh['Accept-Language'] = "en-US,en;q=0.5"
    s.headers.update(qh)
    r1 = s.get('https://core.website.com/CoreCms.aspx', verify=True)
    sh1 = rpt(r1, 'r1')
    c1 = r1.cookies['ASP.NET_SessionId']
    #part 2
    #replicate the login as from firefox...
    postdata = {'username':'[email protected]','password':'passwd'}
    qh['Referer'] = "https://core.website.com/CoreCms.aspx";
    qh['X-Requested-With'] = "XMLHttpRequest"
    qh['Content-Type'] = "application/json; charset=UTF-8"
    qh['Origin'] = "https://core.website.com";
    s.headers.update(qh)
    r2 = 
s.post('https://core.website.com/CoreWebSvc.asmx/InteractiveLogin', 
data=(json.dumps(postdata)).encode('utf-8'), verify=True)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to