[fpc-pascal] Prorammatically sending file using HTTP POST?

Michael Van Canneyt michael at freepascal.org
Wed Apr 4 17:09:49 CEST 2018



On Wed, 4 Apr 2018, Bo Berglund wrote:

> On Wed, 4 Apr 2018 15:29:36 +0200, Luca Olivetti
> <luca at ventoso.org> wrote:
>
>>> By the way, I am using the Indy10 components via the indylaz package.
>>> Lazarus is 1.8.0 and FPC 3.0.4 on Windows7.
>>
>> I never used indy, but you can either use TFPHTTPClient (unit 
>> fphttpclient) or synapse THHPSend.
>> Both allow to send form data.
>> Disregard my suggestion if you prefer to use indy.
>
> Yes, I use Indy since the Delphi days but I have not used it to send
> files before.
> Indy has a TIdHTTP object/component, which presumably can be used but
> there are no good examples I have found that show how to use it for
> simulating POST from a form like the one I showed...

I don't know what a 'good example' is for you, but the code in

https://stackoverflow.com/questions/27257577/indy-mime-decoding-of-multipart-form-data-requests-returns-trailing-cr-lf

Is quite understandable.

Michael.



More information about the fpc-pascal mailing list