Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi How to Use Indy 10 idHTTP : IOHandler value is not valid (https://www.delphipraxis.net/47723-how-use-indy-10-idhttp-iohandler-value-not-valid.html)

inherited 23. Okt 2008 13:34

Re: How to Use Indy 10 idHTTP : IOHandler value is not valid
 
Try the following changes:

databuffer : array[0..4095*sizeof(char)] of char;

dwNumber := sizeof(databuffer) div sizeof(char);

for i := 0 to sizeof(char)-1 do
databuffer[dwread*sizeof(char)-i]:=#0;

untested

Angel4585 23. Okt 2008 14:49

Re: How to Use Indy 10 idHTTP : IOHandler value is not valid
 
In both Indy 9 and Indy 10 i use idhttp1.get(URL) to get the sitecontent..

Assertor 23. Okt 2008 15:04

Re: How to Use Indy 10 idHTTP : IOHandler value is not valid
 
Hi DelphiLover,

despite the fact that you are currently trying to use an approach without Indy for solving your problem I just wanted to let you know that the TIdHTTP component does not have the need to assign an IO handler.

I am currently using the .GET of it without any assigned IO handler inside of my own commercial application. It has been working for a long time now. Using the Indy 10 shipped with Delphi < 2007 as well as the latest available D2009 release version and our own SVN version.

I would suggest trying to create a clean project and use a basic test procedure to check whether it is Indy or something else involved.

By the way: No matter what you hear from others - Indy 9 is more or less deprecated. Indy 10 has had some stability issues and bugs after beeing published but that's also quite some years (!) ago now. The current source is as stable as Indy 9 has been (which also has not been bug free). As you mentioned correctly some issues users have a related to the high abstraction layer Indy provides. There have been many discussions about that including comments from famous TeamB members like Peter Below or Remy LeBeau.

Anyways, good luck for solving your current problem. If you try to do some further tests using Indy you're welcome to give feedback here in order to help us solving the problem.

Cheers
Assertor

MarkusMaier 23. Okt 2008 15:19

Re: How to Use Indy 10 idHTTP : IOHandler value is not valid
 
I was the one who restarted this thread after several years, i had the example code in one of my projects - found it via google and used it instead of using indy.

After a bit of research, i found out that this code works as well (and is less likely to produce errors):

Delphi-Quellcode:
var
  idHtp1:TIdHttp;
begin
  idHtp1:=TIdHTTP.Create(nil);
  Result := '';
  try
    try
      Result := idHtp1.Get(AUrl);
    finally
      FreeAndNil(idhtp1);
    end;
  except
    ;
  end;
end;
Thx to Angel4585 :-)

Assertor 23. Okt 2008 15:27

Re: How to Use Indy 10 idHTTP : IOHandler value is not valid
 
Zitat:

Zitat von MarkusMaier
I was the one who restarted this thread after several years, i had the example code in one of my projects - found it via google and used it instead of using indy.

After a bit of research, i found out that this code works as well
[...]
Thx to Angel4585 :-)

Ah, I see. Missed that. Well, thank you for pointing that out.

Cheers
Assertor


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:05 Uhr.
Seite 2 von 2     12   

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