Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-02

question about fphttpclient

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ched

Dear All,

I use with great success (and pleasure!) the unit fphttpclient under winxp, mageia and raspbian with some code like

WITH TFPHTTPCLIENT.CREATE(NIL) DO
    BEGIN
       REP:=GET(REQ);
       FREE;
    END;

after having defined REQ (+initialisation with some url) and REP as ansistring's. To download text and html pages, that works very nice.

My questions :
- Can I use the same code to download binary data like gzipped files with no "chance" that the content is translated to a special codepage ?
- How can I have access to the date and size informations on the server side ?

Kindest regards, Ched'

Reply by email

Michael Van Canneyt
to Ched
Ched wrote 17 lines
Dear All, I use with great success (and pleasure!) the unit fphttpclient under winxp, mageia and raspbian with some code like WITH TFPHTTPCLIENT.CREATE(NIL) DO BEGIN REP:=GET(REQ); FREE; END; after having defined REQ (+initialisation with some url) and REP as ansistring's. To download text and html pages, that works very nice. My questions : - Can I use the same code to download binary data like gzipped files with no "chance" that the content is translated to a special codepage ?

Yes.

- How can I have access to the date and size informations on the server side ?

These are reported in the headers.

Michael.

Reply by email