some url can get data(example: http://www.google.com/ ), some others
can't(example: http://anime.xunlei.com/Book/category/610), all url can
browsered by ie or firefox.
how debug can find the reasons?
partly my code:
procedure TFormMain.MenuItemNewStoryClick(Sender: TObject);
var
Urlstr: String;
aHost, aURI: string;
aPort: Word;
node: TTreeNode;
begin
Urlstr := InputBox('Input Comic Story Url',
'Please input comic story url',
'http://anime.xunlei.com/Book/category/610');
if (Urlstr<>'') and (Urlstr<>'http://') then
begin
HTTPClient.Disconnect();
strstream:= TStringStream.Create('');
DecomposeURL(Urlstr, aHost, aURI, aPort);
HTTPClient.Host := aHost;
HTTPClient.URI := aURI;
HTTPClient.Port := aPort;
HTTPClient.SendRequest;
StatusBar.SimpleText := 'Connect...';
end
else
//ShowMessage('Invalid Url');
end;
function TFormMain.HttpClientInput(ASocket: TLHTTPClientSocket; ABuffer:
pchar;
ASize: integer): integer;
var
oldLength: integer;
begin
StatusBar.SimpleText := 'input...';
strstream.WriteString(String(ABuffer));
StatusBar.SimpleText := IntToStr(ASize) + '...';
Result := ASize; // tell the http buffer we read it all
end;