HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Request an account if you don't have one.

Url

Categories: Packages | Libraries

The URL library provides a module Network.URL that makes it easy to work with HTTP URLs.

Links:

Please feel free to update this page with extra documentation and examples of how to use the package.

The following example shows how to parse a URL and then add some parameters to it:

import Network.URL

test x = case importURL x of
           Just u  -> print $ exportURL $ add_param u ("Hello","World?")
           Nothing -> print "invalid URL"

Here is some sample output:

*Main> test "http://www.haskell.org"
"http://www.haskell.org/?Hello=World%3f"

Note that the question mark in the parameters was escaped automatically.

Retrieved from "http://haskell.cs.yale.edu/haskellwiki/Url"

This page has been accessed 1,359 times. This page was last modified 12:13, 13 December 2008. Recent content is available under a simple permissive license.