[Python] Problema con una callback di un sito

flandero flandero a gmail.com
Mer 21 Gen 2015 12:47:47 CET


Ah, pardon, lo hai controllato chiaramente, avrei dovuto leggere meglio
prima fare reply :-)


In genere non ho mai avuto problemi col session forwarding e requests,
componendo il dict cookies con i dati ricevuti:

qui per esempio, uwsgi riceve la sessione via cookie, e lo script di
backend la usa per fare le sue query via requests:

cookie = str(env['HTTP_COOKIE'])
sessid =
cookie[cookie.find('AuthSession=')+len('AuthSession='):cookie.find(';',
cookie.find('AuthSession'))]
if '' == sessid:
  return auth_err
  response = requests.get(url, cookies={'AuthSession': sessid}).json()

spero possa esserti d'aiuto

On Wed, Jan 21, 2015 at 12:38 PM, Guido Dassori <flandero a gmail.com> wrote:

>  la butto lì come banalità, ma fosse mai... sicuro che il responso sia
> json parsabile? non ho letto nei messaggi precedenti se hai controllato il
> contenuto con r1.text
>
> Il 21/01/2015 12:35, Carlos Catucci ha scritto:
>
> 2015-01-21 12:26 GMT+01:00 Marco Beri <marcoberi a gmail.com> <marcoberi a gmail.com>:
>
>
>  Quasi certamente c'è qualcosa di nascosto che viene postato: hai
> analizzato le post?
>
>
> E' quello che sto facendom anon vedo niente altro
>
> Questo e' quello che mi mostra Chrome
>
> Remote Address:xxx.yyy.zzz.11:80
> Request URL:http://www.yyyyyy.it/core/phpLink.php
> Request Method:POST
> Status Code:200 OK
>
> __Request Headers__
>
> Accept:application/json, text/javascript, */*
> Accept-Encoding:gzip, deflate
> Accept-Language:en-US,en;q=0.8
> Cache-Control:no-cache
> Connection:keep-alive
> Content-Length:82
> Content-Type:application/x-www-form-urlencoded
> Cookie:PHPSESSID=kt7i4c87h224svs7u40m355r33;
> optimizelyEndUserId=oeu1421834982213r0.1288211140781641;
> tc_retargetingAB=socio; promotional_NL_stop=true;
> km_ai=PF0baW1GTOZpIgNPr2%2B6LzSPJuU%3D; showed_bar=true;
> __sonar=8064399138776607332; reevoomark_marker=958401293; NOAutoChat=true;
> _gat=1; _ga=GA1.2.664036268.1421834984; kvcd=1421835947258; km_vs=1;
> km_lv=1421835947; TCID=201513119443830769824;
> TCSESSION=201513119441320606627; km_uq=;
> optimizelySegments=%7B%22536872274%22%3A%22false%22%2C%22541725669%22%3A%22none%22%2C%22541725670%22%3A%22gc%22%2C%22546091210%22%3A%22direct%22%2C%221981220307%22%3A%22true%22%2C%222210601437%22%3A%22true%22%7D;
> optimizelyBuckets=%7B%222203491517%22%3A%222226410263%22%2C%222365820178%22%3A%222317660890%22%7D;
> optimizelyPendingLogEvents=%5B%22n%3Dhttp%253A%252F%252Fwww.yyyyyy.it
> %252Fpiccolo-formato%252Fstampa-biglietti-da-visita%252F%26u%3Doeu1421834982213r0.1288211140781641%26wxhr%3Dtrue%26t%3D1421836007864%26f%3D2203491517%2C2365820178%26g%3D1482402631%2C2203491517%2C2365820178%22%5D
> Host:www.yyyyyy.it
> Origin:http://www.yyyyyy.it
> Pragma:no-cache
> Referer:http://www.yyyyyy.it/piccolo-formato/stampa-biglietti-da-visita/
> User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
> Gecko) Chrome/39.0.2171.99 Safari/537.36
> X-Requested-With:XMLHttpRequest
>
> __Form Dataview__        __view source__
>
> func:init
> name:preventivo
> id:346
>
>
>
>
>
>
>
> __Rrsponse Headers__
>
> Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
> Connection:keep-alive
> Content-Encoding:gzip
> Content-Length:20301
> Content-Type:text/html; charset=UTF-8
> Date:Wed, 21 Jan 2015 10:26:48 GMT
> Expires:Thu, 19 Nov 1981 08:52:00 GMT
> Keep-Alive:timeout=5
> Pragma:no-cache
> Server:nginx
> Vary:Accept-Encoding
>
>
>
>
> _______________________________________________
> Python mailing listPython a lists.python.ithttp://lists.python.it/mailman/listinfo/python
>
>
>
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20150121/28c375d9/attachment-0001.html>


Maggiori informazioni sulla lista Python