url-2.1.3: A library for working with URLs.

Copyright(c) Galois, Inc. 2007, 2008
LicenseBSD3
MaintainerIavor S. Diatchki
StabilityProvisional
PortabilityPortable
Safe HaskellSafe
LanguageHaskell98

Network.URL

Description

Provides a convenient way for working with HTTP URLs. Based on RFC 1738. See also: RFC 3986

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

Eq URL Source # 

Methods

(==) :: URL -> URL -> Bool #

(/=) :: URL -> URL -> Bool #

Ord URL Source # 

Methods

compare :: URL -> URL -> Ordering #

(<) :: URL -> URL -> Bool #

(<=) :: URL -> URL -> Bool #

(>) :: URL -> URL -> Bool #

(>=) :: URL -> URL -> Bool #

max :: URL -> URL -> URL #

min :: URL -> URL -> URL #

Show URL Source # 

Methods

showsPrec :: Int -> URL -> ShowS #

show :: URL -> String #

showList :: [URL] -> ShowS #

data URLType Source #

Different types of URL.

Constructors

Absolute Host

Has a host

HostRelative

Does not have a host

PathRelative

Relative to another URL

data Host Source #

Contains information about the connection to the host.

Constructors

Host 

Instances

Eq Host Source # 

Methods

(==) :: Host -> Host -> Bool #

(/=) :: Host -> Host -> Bool #

Ord Host Source # 

Methods

compare :: Host -> Host -> Ordering #

(<) :: Host -> Host -> Bool #

(<=) :: Host -> Host -> Bool #

(>) :: Host -> Host -> Bool #

(>=) :: Host -> Host -> Bool #

max :: Host -> Host -> Host #

min :: Host -> Host -> Host #

Show Host Source # 

Methods

showsPrec :: Int -> Host -> ShowS #

show :: Host -> String #

showList :: [Host] -> ShowS #

secure :: Host -> Bool Source #

Does this host use a "secure" protocol (e.g., https).

secure_prot :: Protocol -> Bool Source #

Is this a "secure" protocol. This works only for known protocols, for RawProt values we return False.

exportURL :: URL -> String Source #

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

importURL :: String -> Maybe URL Source #

Convert a list of "bytes" to a URL.

exportHost :: Host -> String Source #

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

add_param :: URL -> (String, String) -> URL Source #

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

decString :: Bool -> String -> Maybe String Source #

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

encString :: Bool -> (Char -> Bool) -> String -> String Source #

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

ok_url :: Char -> Bool Source #

Characters that do not need to be encoded in URL

ok_path :: Char -> Bool Source #

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