[fpc-pascal] Ethernet Relays

Michael Van Canneyt michael at freepascal.org
Mon May 25 12:54:19 CEST 2020



On Mon, 25 May 2020, James Richters wrote:

> Thanks! 
>
> Is there some convenient way to get the HTML into a Tstringlist?

Yes. Simpleget is overloaded to accept a tstrings:

L:=TstringList.Create;
try
    TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/01',L);
finally
   L.Free;
end;

Michael.
>
> James
>
> -----Original Message-----
> From: fpc-pascal <fpc-pascal-bounces at lists.freepascal.org> On Behalf Of Michael Van Canneyt
> Sent: Monday, May 25, 2020 4:47 AM
> To: james at productionautomation.net; FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Cc: 'Ched' <charles.edouard.des.vastes.vignes at gmail.com>
> Subject: Re: [fpc-pascal] Ethernet Relays
>
>
>
> On Sun, 24 May 2020, James Richters wrote:
>
>> I got this working, thanks for the advice Ched,
>>
>> Here's my test program:
>> uses  fphttpclient;
>> Begin
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/01');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/03');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/05');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/07');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/43');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/09');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/11');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/13');
>> TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/15');
>> End.
>>
>> I have to give it a command to go the next page for some reason or 
>> relays
>> 5-8 won't work...  so now I'm wondering if there is a way I can 
>> retrieve the data that is normally displayed in my browser to I can 
>> see what page number I'm on,  I could also then check the status of 
>> the relays as well by analyzing what I read.
>
> Simpleget is a function that returns the page:
>
> S:=TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/30000/15');
>
> S will contain the page of HTML.
>
> If you need to send a command, you'll probably need to use SimplePost()
>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


More information about the fpc-pascal mailing list