Good Morning!
A simple test. But...
I am just trying to use Get to retrieve a text file.
----------------------------------------------------
object Form1: TForm1
Left = 362
Top = 183
Width = 870
Height = 640
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object edtURL: TEdit
Left = 72
Top = 40
Width = 585
Height = 21
TabOrder = 0
Text = 'edtURL'
end
object mmoPage: TMemo
Left = 64
Top = 168
Width = 705
Height = 393
Lines.Strings = (
'')
TabOrder = 2
end
object btnGet: TButton
Left = 72
Top = 80
Width = 75
Height = 25
Caption = 'btnGet'
TabOrder = 1
OnClick = btnGetClick
end
object idhtp1: TIdHTTP
AllowCookies = True
HandleRedirects = True
ProxyParams.BasicAuthentication = False
ProxyParams.ProxyPort = 0
Request.ContentLength = -1
Request.Accept = 'text/html, */*'
Request.BasicAuthentication = False
Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
HTTPOptions = [hoForceEncodeParams]
Left = 208
Top = 80
end
end
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls, IdIOHandler, IdIOHandlerStream;
type
TForm1 = class(TForm)
edtURL: TEdit;
mmoPage: TMemo;
btnGet: TButton;
idhtp1: TIdHTTP;
procedure btnGetClick(Sender: TObject);
private
strData: string;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btnGetClick(Sender: TObject);
begin
strData := idhtp1.Get(edtURL.Text);
mmoPage.Lines.Add(strData);
end;
end.
------>>>>> 'HTTP/1.1 404 Not Found' <<<<<-------
What am I missing here?
----------------------------------------------------
Cya...Dan'l
____________________________________
Every day with Jesus is a Great! day
and He loves YOU!