Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi INDY10-login ueber post (https://www.delphipraxis.net/106588-indy10-login-ueber-post.html)

o0o 13. Jan 2008 13:32


INDY10-login ueber post
 
hi leutz,...bitte nicht boese sein hab schon die suche genutzt und schon lange gefunden wie man post mit indy verschickt fuer zb ne anmeldung etc...

also folgender source hab ich:
Delphi-Quellcode:
var Strings: TStringList;
begin
  Strings := TStringList.Create;
  try
    Strings.Add('username=o0o');
    Strings.Add('passwort=yyy');
    Strings.Add('login=Einloggen');
    try
   memo1.text := idHTTP1.Post('http://www.xxx.de', Strings);
    except
     on E: Exception do
       showmessage('Error encountered during POST: ' + E.Message);
    end;
  finally
    Strings.Free;
  end;
  end;
eigendlich sollte das auch stimmen nehm ich mal an aber wenn ich es testen will bekomme ich folgende fehlermeldung:
http/1.1 302 found

wenn ich jedoch danach nochmal den code ausfuehre funkt alles einwandfrei,...also die fehlermeldung kommt nur beim ersten mal 0_o

waere nice wenn jemand einen rat haette:)

thx im vorraus...da o0o

ps hier der htmlcode falls hilft:
Zitat:

<form action="" method="post" name="login">
<span class="logintext">Username:</span><input type="text" name="username" class="loginfeld" maxlength="25" value="" >
<span class="logintext">Passwort:</span><input type="password" name="passwort" class="loginfeld" maxlength="25" value="" >
<input type="Submit" name="login" class="loginenter" value="Einloggen">
</form>

Christian Seehase 13. Jan 2008 16:15

Re: INDY10-login ueber post
 
Moin oOo,

schau Dir doch mal die Bedeutung der HTTP-Statuscodes an

o0o 13. Jan 2008 23:56

Re: INDY10-login ueber post
 
thx fuer die info:)

wusste damit zwar nix anzufangen aber ein kumpel hat mir per messenger geholfeb^^

damit klappts jetzt:
Delphi-Quellcode:
var Strings: TStringList;
begin
  Strings := TStringList.Create;
  try
    Strings.Add('username=o0o');
    Strings.Add('passwort=yyy');
    Strings.Add('login=Einloggen');
    IdHTTP1.HandleRedirects := True;// <- hier die aenderung
    try
   memo1.text := idHTTP1.Post('http://www.xxx.de', Strings);
    except
     on E: Exception do
       showmessage('Error encountered during POST: ' + E.Message);
    end;
  finally
    Strings.Free;
  end;
thx an alle die geholfen habn bzw es versucht haben:)

da o0o


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:41 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz