Delphi Http get request issue via /r/learnprogramming

Delphi Http get request issue

trying to learn some of the basics of Pascal in Delphi. ran into an error with the get request, I simply get an access violation error on the http.Get line.

The code I have is: (alt screen shot if you like the colours

unit Unit2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, IdHTTP; type TForm2 = class(TForm) Button1: TButton; Edit1: TEdit; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation {$R *.dfm} uses Unit1; procedure TForm2.Button1Click(Sender: TObject); var Form1: TForm1; begin Form1 := TForm1.Create(nil); try Form1.ShowModal; finally Form1.Free; end; end; procedure TForm2.Button2Click(Sender: TObject); var http: TIdHTTP; var Result: string; begin http := http.Create; try Result := http.Get(';) finally http.Free; end; Edit1.Text := Result; end; end. 

Submitted July 10, 2017 at 04:56PM by craig395
via reddit


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s