[fpc-pascal] Improvement to TFPHTTPClient Class
African Wild Dog
paintedlycaon at gmail.com
Thu Jul 21 04:17:42 CEST 2016
2016-07-20 3:45 Michael Van Canneyt <michael at freepascal.org>:
Because all Pascal TCP toolkits out there offer a HTTP Client. (lnet, indy,
> synapse). By doing this, I leave the choice up to the user which one to use
> for various APIs that are built ON TOP of HTTP.
>
> Your use case is simply one I didn't foresee,
> Because I assume that any decent TCP toolkit offers a HTTP client.
>
> However, now that I understand what you actually need, we can consider
> this use-case.
>
>
The change I am proposing should be accepted even if i did not have that
problem to solve. Decoupling the TFPHTTPClient class from the underlying
socket framework brings many benefits. Perhaps, the most important benefity
is improving the testability of the class. For example, one can test the
core functionality of the TFPHTTPClient through "fake" TCP adapters.
> I will accept the patch, on the condition that you provide a binding for a
> C
> TCP/IP library too. If your c library is open source, then we can use that.
> if not, then I'd ask you to provide an libevent implementation.
>
> It has no point abstracting out something if we have only 1 implementation.
>
>
Great! I will provide the bindings. My bindings are for the Mozilla 's NSPR
toolkit <https://developer.mozilla.org/pt-BR/docs/NSPR>.
Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160720/2cce7d6f/attachment.html>
More information about the fpc-pascal
mailing list