Prima di tutto ti ringrazio moltissimo per il tempo che mi ha dedicato :-) e per gli ottimi consigli.
Allora ho provato wireshark per vedere che comandi venivano inviati ed ho trovato questo per l'invio della password
codice:
Hypertext Transfer Protocol
POST /selfcare/login HTTP/1.1\r\n
Host: areaclienti.tre.it\r\n
Connection: keep-alive\r\n
Referer: http://areaclienti.tre.it/selfcare/a...A_HTML.xsl\r\n
Content-Length: 59\r\n
Cache-Control: max-age=0\r\n
Origin: http://areaclienti.tre.it\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.416.0 Safari/534.1\r\n
Accept-Encoding: gzip,deflate,sdch\r\n
Accept-Language: it,en;q=0.8\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n
[truncated] Cookie: __utmz=195710076.1274984399.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=195710076.117374508.1274984399.1274984399.1274984399.1; __utmz=246631489.1275132944.16.8.utmcsr=google|utmccn=(organic)|utmcmd=organi
\r\n
Line-based text data: application/x-www-form-urlencoded
proposition=consumer&username=xxxxxx&password=xxxxxxx
Allora ho scritto questo
codice:
SocketConnection client = (SocketConnection)Connector.open("socket://areaclienti.tre.it:80");
String data = "POST /selfcare/login HTTP/1.1\r\n" +
"Host: areaclienti.tre.it\r\n" +
"User-Agent: Mozilla/5.0 \r\n"+
"Accept:text/html,application/xhtml+xml,application/xml"+
"Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3\r\n"+
"Accept-Encoding: gzip,deflate\r\n"+
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"+
"Keep-Alive: 300\r\n"+
"Connection: keep-alive\r\n"+ "Referer:http://areaclienti.tre.it/selfcare/a...LOGGED.xsl\r\n"+
"Content-Type: application/x-www-form-urlencoded\r\n"+
"Content-Length: 59\r\n"+
"\r\n"+
"proposition=consumer&username=xxxxx&password=xxxx";
OutputStream out = client.openOutputStream();
Niente mi fa sempre la stessa cosa
L'unica cosa che non ho messo è il cookie ma non saprei propio come fare :-(