[Haskell-cafe] Simple HTTP lib for Windows?

Bayley, Alistair Alistair_Bayley at invescoperpetual.co.uk
Mon Jan 29 04:11:18 EST 2007


> From: haskell-cafe-bounces at haskell.org 
> [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Neil Mitchell
> 
> My standard solution was to invoke wget, but a Haskell solution would
> be nicer. For my purpose following redirects etc. isn't required, so
> thanks very much for your help. I will be releasing this function as
> part of a library shortly, so will be giving you credit for your help!
> 
> Neil

Good god, no! The code was merely meant to illustrate how a really basic
HTTP GET might work. It certainly doesn't deal with a lot of the
additional cases, like redirects and resource moves, and
non-standards-compliant HTTP servers. I'm no HTTP expert, so for all I
know this example code is likely non-standards-compliant too. It really
only works for a very straightforward text file GET, and there's no
exception or error handling, or any of the more interesting cases.

You may or may not know that there are a large number of webserver
implementations which do not respect the HTTP standards (1.0 or 1.1),
and HTTP clients (like web browsers) have to go to some lengths in order
to get sensible responses out of most of them. So pure Haskell code
(i.e. no FFI calls to a C HTTP lib) should probably consider a large
subset of these non-standard behaviours, too.

OTOH, if your needs really are very simple, then fine. But be aware that
"doing the right thing" with real-world HTTP responses can be a
can-o'-worms.

Alistair
*****************************************************************
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*****************************************************************


More information about the Haskell-Cafe mailing list