Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi idhttp.DoRequest - zu schwer für mich! (https://www.delphipraxis.net/23350-idhttp-dorequest-zu-schwer-fuer-mich.html)

TheMiller 1. Jun 2004 21:23


idhttp.DoRequest - zu schwer für mich!
 
Hey Leute.... :?

Habe schon fast keine Lust mehr, möchte es aber heute noch fertigstellen. Wie kann ich den Request senden, dass sich mich Prog anmeldet. Als Hint steht folgendes da:

Delphi-Quellcode:
procedure DoRequest(const AMethod: TIdHTTPMethod; AURL: string; const ASource: TObject; const
 AResponseContent: TStream); virtual;
Ich möchte die von "www.xxx.de/yyy" die Datei "zzz.000" Downloaden. Ich komme mit der Aufforderung nicht zurecht. Habe es so probiert:

Delphi-Quellcode:
idhttp.DoRequest(hmget,'www.xxx.de/yyy','zzz.ooo',stream);
aber das funzt nicht. Hatte auch noh zahlreiche andere Versuche.... bitte um Hilfe. evtl auch Erklärung!

Danke schonmal!
*geärgertbin*

Ultimator 1. Jun 2004 21:29

Re: idhttp.DoRequest - zu schwer für mich!
 
zzz.ooo ist doch kein TObject. :gruebel:

TheMiller 1. Jun 2004 21:42

Re: idhttp.DoRequest - zu schwer für mich!
 
Ja, das ist ja mein Problem. Wie definiere ich dieses Objekt? Oder bzw. wie definiere ich ein Objekt?

Ultimator 1. Jun 2004 22:02

Re: idhttp.DoRequest - zu schwer für mich!
 
Ein Objekt wäre z.B. ein Memo oder ein Edit-Feld. Aber was man da mchen muss, weiß ich leider auch nicht. :(

DataCool 2. Jun 2004 11:23

Re: idhttp.DoRequest - zu schwer für mich!
 
Hi,

schonmal mit idhttp.get probiert ? :zwinker:

Smokey 2. Jun 2004 11:46

Re: idhttp.DoRequest - zu schwer für mich!
 
Also so geht es bei mir, wenn ich ein Bild, dass online den namen "Weiber.jpg" hat, auf meiner Festplatte als Test.jpg speichern will. Mfg smk

Delphi-Quellcode:
var
  strmDatei: TFileStream;
  IdHttp1: TIdHTTP;
  sURL, sFilename: String;
begin

  sFilename := 'c:\\Test.jpg'
  try
    try
      strmDatei:=TFileStream.create(sFilename,fmCreate);
      SURL:= 'http://www.blabla.com/pics/weiber.jpg'
      IdHttp1:= TIdHTTP.Create(nil);
      IdHttp1.Get(sURL,strmDatei);
    except
      on excp: Exception do begin
       //fehlerbehandlung deiner wahl
       
      end;//except
    end;
  finally
    strmDatei.free;
    IdHttp1.Free;
  end;

end;

TheMiller 2. Jun 2004 16:16

Re: idhttp.DoRequest - zu schwer für mich!
 
Hi,

das ist auch kein Problem. Meine Quellseite hat einen .htaccess-Schutz (du musst User und PWD beim connecten übermitteln). Dazu benötige ich die Funktion DoRequest. Aber da weis ich nicht, wie ich die Funktion aufstelle...

edit:
@DataCool: Ja, habe ich! Es kommt die Fehlermeldung "301: permantly moving". Logge ich mich normal ein, dann geht es ohne murren (normal einloggen: über IE und dann in den Login-Bereich)

/edit


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