url-1.0.1: A library for working with URLs.

PortabilityPortable
StabilityProvisional
MaintainerIavor S. Diatchki

Network.URL

Description

Provides a convinient way for working with HTTP URLs. Based on RFC 1738.

Synopsis

Documentation

data URL Source

A type for working with URL. The parameters are in application/x-www-form-urlencoded format: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1

Constructors

URL 

Instances

data URLType Source

Different types of URL.

Constructors

Absolute Host

Has a host

HostRelative

Does not have a host

PathRelative

Rleative to another URL

data Host Source

Contains information about the connection to the host.

Constructors

Host 

Fields

secure :: Bool
 
host :: String
 
port :: Maybe Integer
 

Instances

exportURL :: URL -> StringSource

Convert a URL to a list of bytes. We represent non-ASCII characters using UTF8.

importURL :: String -> Maybe URLSource

Convert a list of bytes to a URL.

exportHost :: Host -> StringSource

Convert the host part of a URL to a list of bytes.

add_param :: URL -> (String, String) -> URLSource

Add a (key,value) parameter to a URL.

decString :: Bool -> String -> Maybe StringSource

Decode a list of bytes to a string. Performs % and UTF8 decoding.

encString :: Bool -> (Char -> Bool) -> String -> StringSource

Convert a string to bytes by escaping the characetrs that do not satisfy the input predicate. The first argument specifies if we should replace spaces with +.

ok_url :: Char -> BoolSource

Characters that may appear in the textual representation of a URL

ok_path :: Char -> BoolSource

Characters that can appear non % encoded in the path part of the URL