View on GitHub

curlhs

Haskell bindings to curl library (libcurl)

Download this project as a .zip file Download this project as a tar.gz file

Network.CURL

curlhs is a Haskell package that provides a Haskell interface to libcurl, the multiprotocol file transfer library. And libcurl ...

libcurl is most probably the most portable, most powerful and most often used C-based multi-platform file transfer library on this planet - be it open source or commercial.

Installation

curlhs is written in the Haskell programming language and requires the Haskell compiler GHC and the Haskell's package manager Cabal to build and install. The easiest way to get them is with a binary installer of the Haskell Platform.

If you have the right setup, then getting curlhs should be as simple as running two commands:

$ cabal update
$ cabal install curlhs

This will download and install the latest curlhs package from Hackage.

You don't need libcurl to install curlhs, and you don't need it also to build programs that use curlhs. But you need to have an appropriate version of libcurl in scope to execute those programs later. The dynamic loading mechanisms are used behind the scenes to link/load libcurl at runtime.

Documentation

As usual for Haskell packages, the first place to search for documentation is Hackage. More docs, like examples and tutorials, may be found directly on GitHub project page. Start with README.

In addition, the main libcurl website contains a vast amount of documentation and other resources. It is highly recommended to be familiar with those materials to use curlhs.

Example

ghci> :m Network.CURL720
ghci> loadlib CURL720
ghci> curl_version
"libcurl/7.37.1 OpenSSL/1.0.1e zlib/1.2.8"

curlhs must be explicitly linked with libcurl at runtime. loadlib CURL720 in the example above first tries to load libcurl binary image into memory, than checks its version (in this case it must be libcurl/7.20 or higher). Loader looks for libcurl.so on UNIX-like systems, libcurl.dll on Windows and libcurl.dylib on OS X respectively. For more info please search the docs on GitHub.

License

Copyright (c) 2012-2014 Krzysztof Kardzis

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Analytics