Witam, co robie źle? Probowałem juz wszystkiego. Na zwykłe http loguje sie bez problemu, a z https juz nie. Niby wszystk ok, a nie loguje sie.
procedure TForm1.Button1Click(Sender: TObject);
var
HTTP: TidHTTP;
html, s: string;
i: integer;
StreamIn: TStringStream;
begin
HTTP := TidHTTP.Create(nil);
StreamIn:= TStringStream.Create('');
HTTP.IOHandler:= Form1.IdSSLIOHandlerSocket1;
Http.Request.UserAgent:= 'Mozilla/5.0 (Windows; U; Windows NT 5.0; pl-PL; rv:1.7.6) Gecko/20050226 Firefox/1.0.1';
StreamIn.WriteString('uselandingpage=1&login=******&password=*****');
try
HTTP.HandleRedirects := True;
HTTP.AllowCookies := True;
HTTP.Request.ContentType :='application/x-www-form-urlencoded';
html := HTTP.Post('https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi',StreamIn);
s := 'Cookies: ';
if HTTP.CookieManager.CookieCollection.Count > 0 then
for i := 0 to HTTP.CookieManager.CookieCollection.Count - 1 do
s := s + HTTP.CookieManager.CookieCollection.Items[i].CookieText;
Memo1.Lines.Add(s);
// Cookies: user=login-zakodowanehaslo; path=/; domain=.rapidshare.com
memo1.Lines.add(HTTP.response.ResponseText);
//HTTP/1.1 200 OK
memo1.Lines.add(HTTP.Request.RawHeaders.Text);
// Content-Type: application/x-www-form-urlencoded
// Content-Length: 46
// Host: ssl.rapidshare.com:443
// Accept: text/html, */*
// User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; pl-PL; rv:1.7.6) Gecko/20050226 Firefox/1.0.1
finally
FreeAndNil(HTTP);
end;
end;