[fpc-pascal] Improvement to TFPHTTPClient Class

African Wild Dog paintedlycaon at gmail.com
Wed Jul 20 03:45:18 CEST 2016


2016-07-19 4:52 GMT-03:00 Michael Van Canneyt <michael at freepascal.org>:

>
> 1. The whole point of TFPHTTPClient is exactly to couple it to sockets
>    framework (fcl-net).
>    If you want to use synapse, use httpsend. lnet has a similar component
>    for the http protocol.
>
>
I dont want to use synapse. I am developing bindings for a c library. The
library offers TCP connection functionality but does not provide any
support for http. I need to use that library due to some particularities of
my project.

I do not understand the need for such coupling between http client and
fcl-net. It is like coupling SQLDb with a specific RDBMS.


> 2. I favour the opposite approach. Abstract out the underlying HTTP
> implementation
>    at a higher level.
>

Why should we duplicate the code? Why should we implement the same
functionality in several diferent places?


>
>    For this I have introduced FPWebclient, which has 2 implementations:
>    TFPHTTPClient and Synapse.
>
>
Through TAbstractWebClient you are introducing another level of complexity
to do the same task: perform http requests. TAbstractWebClient is actually
an adapter to diferent http implementations. TAbstractWebClient is an
interesting class. However, It is a poor solution, IMHO.

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160719/9bd67292/attachment.html>


More information about the fpc-pascal mailing list