Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi idhttp + SSL - Post BAdRequest (https://www.delphipraxis.net/178232-idhttp-ssl-post-badrequest.html)

sonny2007 25. Dez 2013 09:13

idhttp + SSL - Post BAdRequest
 
Hallo Delphianer ,

ich doktor seit 2 Tagen an folgenden Problem.
Ich möchte mich auf der Seite https://account.guildwars2.com/login anmelden.

Daraufhin erhalte ich ja den Cookie und somit meine Session Id. Nur das Post schlägt schon fehl.
Ich habe die Werte mit Fiddler überprüft.
Auch das Password und die email sind richtig.

Woran kann es liegen das dies immer fehl schlägt ?

Vielen Dank im Voraus.
Gruß sonny

Code:
procedure TForm1.Button2Click(Sender: TObject);
var
  cookie: TIdCookieManager;
  mySSL: TIdSSLIOHandlerSocketOpenSSL;
  lStream: TStringStream;
  Params: TStringList;
  Enc : Tencoding;
begin
  try
    lStream := TStringStream.Create;
    mySSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
    cookie := TidCookieManager.Create(nil);
    enc := TEncoding.Create;


    idhttp1.IOHandler := mySSL;
    idhttp1.CookieManager := cookie;
    idhttp1.AllowCookies := true;
    with idhttp1.request do
    begin
      Accept := '*/*';
      ContentType := 'application/x-www-form-urlencoded';
      CharSet := 'UTF-8';
      AcceptLanguage := 'de-DE';
      AcceptEncoding := 'gzip, deflate';
      UserAgent := 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko';
      Host := 'account.guildwars2.com';
      Connection := 'Keep-Alive';
      CacheControl := 'no-cache';
    end;
    Params := TStringList.Create;
    with Params do
        begin
          Add('email=myemail');
          Add('password=mypassword');
        end;
        enc := CharsetToEncoding(idhttp1.Request.CharSet);
        // Daten senden
        memo1.Lines.Add(idhttp1.Post('https://account.guildwars2.com/login', Params,Enc));
  finally
    FreeAndNil(lStream);
    cookie.Free;
    myssl.Free;
    Params.Free;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:42 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