Url

From HaskellWiki
Revision as of 22:18, 11 December 2008 by AlmonPasra (talk | contribs) (http://woelgin.interfree.it/topic-118.html)
Jump to navigation Jump to search

[hirsute ladies|http://woelgin.interfree.it/topic-118.html] [hirsute ladies] ladies ((http://woelgin.interfree.it/topic-118.html hirsute ladies)) [| hirsute ladies] "hirsute ladies":http://woelgin.interfree.it/topic-118.html [wood gasification stoves|http://miminerv.strefa.pl/20081128-wood-gasification.html] [wood gasification stoves] gasification stoves ((http://miminerv.strefa.pl/20081128-wood-gasification.html wood gasification stoves)) [| wood gasification stoves] "wood gasification stoves":http://miminerv.strefa.pl/20081128-wood-gasification.html [tomato recipes|http://liendar.ifrance.com/page365.html] [tomato recipes] recipes ((http://liendar.ifrance.com/page365.html tomato recipes)) [| tomato recipes] "tomato recipes":http://liendar.ifrance.com/page365.html [licensed professional counselors medicare|http://vastack.interfree.it/20081205-licensed-professional.html] [licensed professional counselors medicare] professional counselors medicare ((http://vastack.interfree.it/20081205-licensed-professional.html licensed professional counselors medicare)) [| licensed professional counselors medicare] "licensed professional counselors medicare":http://vastack.interfree.it/20081205-licensed-professional.html [tips for metroid prime 2|http://enpasel.ifrance.com/1014678752.htm] [tips for metroid prime 2] for metroid prime 2 ((http://enpasel.ifrance.com/1014678752.htm tips for metroid prime 2)) [| tips for metroid prime 2] "tips for metroid prime 2":http://enpasel.ifrance.com/1014678752.htm [andrew school of medical transcription|http://lakinkea.strefa.pl/comment-1622.htm] [andrew school of medical transcription] school of medical transcription ((http://lakinkea.strefa.pl/comment-1622.htm andrew school of medical transcription)) [| andrew school of medical transcription] "andrew school of medical transcription":http://lakinkea.strefa.pl/comment-1622.htm [fort myers beach new homes|http://wejolly.strefa.pl/fort-myers-beach-20081128.html] [fort myers beach new homes] myers beach new homes ((http://wejolly.strefa.pl/fort-myers-beach-20081128.html fort myers beach new homes)) [| fort myers beach new homes] "fort myers beach new homes":http://wejolly.strefa.pl/fort-myers-beach-20081128.html [music pitbull shake video|http://wejolly.strefa.pl/music-pitbull-20081123.html] [music pitbull shake video] pitbull shake video ((http://wejolly.strefa.pl/music-pitbull-20081123.html music pitbull shake video)) [| music pitbull shake video] "music pitbull shake video":http://wejolly.strefa.pl/music-pitbull-20081123.html [handheld pos restaurant|http://miminerv.strefa.pl/20081122-restaurant-pos.html] [handheld pos restaurant] pos restaurant ((http://miminerv.strefa.pl/20081122-restaurant-pos.html handheld pos restaurant)) [| handheld pos restaurant] "handheld pos restaurant":http://miminerv.strefa.pl/20081122-restaurant-pos.html [pink floyd live at pompeii torrent|http://kamada.strefa.pl/page1518.html] [pink floyd live at pompeii torrent] floyd live at pompeii torrent ((http://kamada.strefa.pl/page1518.html pink floyd live at pompeii torrent)) [| pink floyd live at pompeii torrent] "pink floyd live at pompeii torrent":http://kamada.strefa.pl/page1518.html 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.