Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- uRICopy
- uRICopyHost
- uRIDecode
- uRIEncode
- uRIEqual
- uRIFree
- uRIGetFragment
- uRIGetHost
- uRIGetPassword
- uRIGetPath
- uRIGetPort
- uRIGetQuery
- uRIGetScheme
- uRIGetUser
- uRIHostEqual
- uRIHostHash
- uRINew
- uRINewWithBase
- uRINormalize
- uRISetFragment
- uRISetHost
- uRISetPassword
- uRISetPath
- uRISetPort
- uRISetQuery
- uRISetQueryFromForm
- uRISetScheme
- uRISetUser
- uRIToString
- uRIUsesDefaultPort
- Properties
A SoupURI supports RFC 3986 (URI Generic Syntax), and can parse any valid URI. However, libsoup only uses "http" and "https" URIs internally; You can use SOUP_URI_VALID_FOR_HTTP() to test if a #SoupURI is a valid HTTP URI.
scheme will always be set in any URI. It is an interned string and
is always all lowercase. (If you parse a URI with a non-lowercase
scheme, it will be converted to lowercase.) The macros
%SOUP_URI_SCHEME_HTTP and %SOUP_URI_SCHEME_HTTPS provide the
interned values for "http" and "https" and can be compared against
URI
scheme values.
user and
password are parsed as defined in the older URI specs
(ie, separated by a colon; RFC 3986 only talks about a single
"userinfo" field). Note that @password is not included in the
output of soup_uri_to_string(). libsoup does not normally use these
fields; authentication is handled via #SoupSession signals.
host contains the hostname, and
port the port specified in the
URI. If the URI doesn't contain a hostname, host will be %NULL,
and if it doesn't specify a port,
port may be 0. However, for
"http" and "https" URIs, host is guaranteed to be non-%NULL
(trying to parse an http URI with no
host will return %NULL), and
@port will always be non-0 (because libsoup knows the default value
to use when it is not specified in the URI).
path is always non-%NULL. For http/https URIs,
path will never be
an empty string either; if the input URI has no path, the parsed
#SoupURI will have a @path of "/".
query and
fragment are optional for all URI types.
soup_form_decode() may be useful for parsing @query.
Note that path,
query, and fragment may contain
%---encoded characters. soup_uri_new() calls
soup_uri_normalize() on them, but not soup_uri_decode(). This is
necessary to ensure that soup_uri_to_string() will generate a URI
that has exactly the same meaning as the original. (In theory,
#SoupURI should leave
user, password, and
host partially-encoded
as well, but this would be more annoying than useful.)
- newtype URI = URI (ForeignPtr URI)
- newZeroURI :: MonadIO m => m URI
- noURI :: Maybe URI
- data URICopyMethodInfo
- uRICopy :: MonadIO m => URI -> m URI
- data URICopyHostMethodInfo
- uRICopyHost :: MonadIO m => URI -> m URI
- uRIDecode :: MonadIO m => Text -> m Text
- uRIEncode :: MonadIO m => Text -> Maybe Text -> m Text
- data URIEqualMethodInfo
- uRIEqual :: MonadIO m => URI -> URI -> m Bool
- data URIFreeMethodInfo
- uRIFree :: MonadIO m => URI -> m ()
- data URIGetFragmentMethodInfo
- uRIGetFragment :: MonadIO m => URI -> m Text
- data URIGetHostMethodInfo
- uRIGetHost :: MonadIO m => URI -> m Text
- data URIGetPasswordMethodInfo
- uRIGetPassword :: MonadIO m => URI -> m Text
- data URIGetPathMethodInfo
- uRIGetPath :: MonadIO m => URI -> m Text
- data URIGetPortMethodInfo
- uRIGetPort :: MonadIO m => URI -> m Word32
- data URIGetQueryMethodInfo
- uRIGetQuery :: MonadIO m => URI -> m Text
- data URIGetSchemeMethodInfo
- uRIGetScheme :: MonadIO m => URI -> m Text
- data URIGetUserMethodInfo
- uRIGetUser :: MonadIO m => URI -> m Text
- data URIHostEqualMethodInfo
- uRIHostEqual :: MonadIO m => URI -> URI -> m Bool
- data URIHostHashMethodInfo
- uRIHostHash :: MonadIO m => URI -> m Word32
- uRINew :: MonadIO m => Maybe Text -> m (Maybe URI)
- data URINewWithBaseMethodInfo
- uRINewWithBase :: MonadIO m => URI -> Text -> m URI
- uRINormalize :: MonadIO m => Text -> Maybe Text -> m Text
- data URISetFragmentMethodInfo
- uRISetFragment :: MonadIO m => URI -> Maybe Text -> m ()
- data URISetHostMethodInfo
- uRISetHost :: MonadIO m => URI -> Maybe Text -> m ()
- data URISetPasswordMethodInfo
- uRISetPassword :: MonadIO m => URI -> Maybe Text -> m ()
- data URISetPathMethodInfo
- uRISetPath :: MonadIO m => URI -> Text -> m ()
- data URISetPortMethodInfo
- uRISetPort :: MonadIO m => URI -> Word32 -> m ()
- data URISetQueryMethodInfo
- uRISetQuery :: MonadIO m => URI -> Maybe Text -> m ()
- data URISetQueryFromFormMethodInfo
- uRISetQueryFromForm :: MonadIO m => URI -> Map Text Text -> m ()
- data URISetSchemeMethodInfo
- uRISetScheme :: MonadIO m => URI -> Text -> m ()
- data URISetUserMethodInfo
- uRISetUser :: MonadIO m => URI -> Maybe Text -> m ()
- data URIToStringMethodInfo
- uRIToString :: MonadIO m => URI -> Bool -> m Text
- data URIUsesDefaultPortMethodInfo
- uRIUsesDefaultPort :: MonadIO m => URI -> m Bool
- uRIClearFragment :: MonadIO m => URI -> m ()
- uRIFragment :: AttrLabelProxy "fragment"
- uRIReadFragment :: MonadIO m => URI -> m (Maybe Text)
- uRIWriteFragment :: MonadIO m => URI -> CString -> m ()
- uRIClearHost :: MonadIO m => URI -> m ()
- uRIHost :: AttrLabelProxy "host"
- uRIReadHost :: MonadIO m => URI -> m (Maybe Text)
- uRIWriteHost :: MonadIO m => URI -> CString -> m ()
- uRIClearPassword :: MonadIO m => URI -> m ()
- uRIPassword :: AttrLabelProxy "password"
- uRIReadPassword :: MonadIO m => URI -> m (Maybe Text)
- uRIWritePassword :: MonadIO m => URI -> CString -> m ()
- uRIClearPath :: MonadIO m => URI -> m ()
- uRIPath :: AttrLabelProxy "path"
- uRIReadPath :: MonadIO m => URI -> m (Maybe Text)
- uRIWritePath :: MonadIO m => URI -> CString -> m ()
- uRIPort :: AttrLabelProxy "port"
- uRIReadPort :: MonadIO m => URI -> m Word32
- uRIWritePort :: MonadIO m => URI -> Word32 -> m ()
- uRIClearQuery :: MonadIO m => URI -> m ()
- uRIQuery :: AttrLabelProxy "query"
- uRIReadQuery :: MonadIO m => URI -> m (Maybe Text)
- uRIWriteQuery :: MonadIO m => URI -> CString -> m ()
- uRIClearScheme :: MonadIO m => URI -> m ()
- uRIReadScheme :: MonadIO m => URI -> m (Maybe Text)
- uRIScheme :: AttrLabelProxy "scheme"
- uRIWriteScheme :: MonadIO m => URI -> CString -> m ()
- uRIClearUser :: MonadIO m => URI -> m ()
- uRIReadUser :: MonadIO m => URI -> m (Maybe Text)
- uRIUser :: AttrLabelProxy "user"
- uRIWriteUser :: MonadIO m => URI -> CString -> m ()
Exported types
URI (ForeignPtr URI) |
BoxedObject URI | |
(~) AttrOpTag tag AttrSet => Constructible URI tag | |
((~) * signature (m Bool), MonadIO m) => MethodInfo * URIUsesDefaultPortMethodInfo URI signature | |
((~) * signature (Bool -> m Text), MonadIO m) => MethodInfo * URIToStringMethodInfo URI signature | |
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetUserMethodInfo URI signature | |
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * URISetSchemeMethodInfo URI signature | |
((~) * signature (Map Text Text -> m ()), MonadIO m) => MethodInfo * URISetQueryFromFormMethodInfo URI signature | |
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetQueryMethodInfo URI signature | |
((~) * signature (Word32 -> m ()), MonadIO m) => MethodInfo * URISetPortMethodInfo URI signature | |
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * URISetPathMethodInfo URI signature | |
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetPasswordMethodInfo URI signature | |
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetHostMethodInfo URI signature | |
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetFragmentMethodInfo URI signature | |
((~) * signature (Text -> m URI), MonadIO m) => MethodInfo * URINewWithBaseMethodInfo URI signature | |
((~) * signature (m Word32), MonadIO m) => MethodInfo * URIHostHashMethodInfo URI signature | |
((~) * signature (URI -> m Bool), MonadIO m) => MethodInfo * URIHostEqualMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetUserMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetSchemeMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetQueryMethodInfo URI signature | |
((~) * signature (m Word32), MonadIO m) => MethodInfo * URIGetPortMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetPathMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetPasswordMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetHostMethodInfo URI signature | |
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetFragmentMethodInfo URI signature | |
((~) * signature (m ()), MonadIO m) => MethodInfo * URIFreeMethodInfo URI signature | |
((~) * signature (URI -> m Bool), MonadIO m) => MethodInfo * URIEqualMethodInfo URI signature | |
((~) * signature (m URI), MonadIO m) => MethodInfo * URICopyHostMethodInfo URI signature | |
((~) * signature (m URI), MonadIO m) => MethodInfo * URICopyMethodInfo URI signature | |
((~) * info (ResolveURIMethod t URI), MethodInfo * info URI p) => IsLabelProxy t (URI -> p) | |
type AttributeList URI |
newZeroURI :: MonadIO m => m URI Source
Construct a URI
struct initialized to zero.
Methods
uRICopy
data URICopyMethodInfo Source
((~) * signature (m URI), MonadIO m) => MethodInfo * URICopyMethodInfo URI signature |
uRICopyHost
data URICopyHostMethodInfo Source
((~) * signature (m URI), MonadIO m) => MethodInfo * URICopyHostMethodInfo URI signature |
uRICopyHost :: MonadIO m => URI -> m URI Source
uRIDecode
uRIEncode
uRIEqual
data URIEqualMethodInfo Source
((~) * signature (URI -> m Bool), MonadIO m) => MethodInfo * URIEqualMethodInfo URI signature |
uRIFree
data URIFreeMethodInfo Source
((~) * signature (m ()), MonadIO m) => MethodInfo * URIFreeMethodInfo URI signature |
uRIGetFragment
data URIGetFragmentMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetFragmentMethodInfo URI signature |
uRIGetFragment :: MonadIO m => URI -> m Text Source
uRIGetHost
data URIGetHostMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetHostMethodInfo URI signature |
uRIGetHost :: MonadIO m => URI -> m Text Source
uRIGetPassword
data URIGetPasswordMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetPasswordMethodInfo URI signature |
uRIGetPassword :: MonadIO m => URI -> m Text Source
uRIGetPath
data URIGetPathMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetPathMethodInfo URI signature |
uRIGetPath :: MonadIO m => URI -> m Text Source
uRIGetPort
data URIGetPortMethodInfo Source
((~) * signature (m Word32), MonadIO m) => MethodInfo * URIGetPortMethodInfo URI signature |
uRIGetPort :: MonadIO m => URI -> m Word32 Source
uRIGetQuery
data URIGetQueryMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetQueryMethodInfo URI signature |
uRIGetQuery :: MonadIO m => URI -> m Text Source
uRIGetScheme
data URIGetSchemeMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetSchemeMethodInfo URI signature |
uRIGetScheme :: MonadIO m => URI -> m Text Source
uRIGetUser
data URIGetUserMethodInfo Source
((~) * signature (m Text), MonadIO m) => MethodInfo * URIGetUserMethodInfo URI signature |
uRIGetUser :: MonadIO m => URI -> m Text Source
uRIHostEqual
data URIHostEqualMethodInfo Source
((~) * signature (URI -> m Bool), MonadIO m) => MethodInfo * URIHostEqualMethodInfo URI signature |
uRIHostHash
data URIHostHashMethodInfo Source
((~) * signature (m Word32), MonadIO m) => MethodInfo * URIHostHashMethodInfo URI signature |
uRIHostHash :: MonadIO m => URI -> m Word32 Source
uRINew
uRINewWithBase
data URINewWithBaseMethodInfo Source
((~) * signature (Text -> m URI), MonadIO m) => MethodInfo * URINewWithBaseMethodInfo URI signature |
uRINormalize
uRISetFragment
data URISetFragmentMethodInfo Source
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetFragmentMethodInfo URI signature |
uRISetHost
data URISetHostMethodInfo Source
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetHostMethodInfo URI signature |
uRISetPassword
data URISetPasswordMethodInfo Source
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetPasswordMethodInfo URI signature |
uRISetPath
data URISetPathMethodInfo Source
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * URISetPathMethodInfo URI signature |
uRISetPath :: MonadIO m => URI -> Text -> m () Source
uRISetPort
data URISetPortMethodInfo Source
((~) * signature (Word32 -> m ()), MonadIO m) => MethodInfo * URISetPortMethodInfo URI signature |
uRISetPort :: MonadIO m => URI -> Word32 -> m () Source
uRISetQuery
data URISetQueryMethodInfo Source
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetQueryMethodInfo URI signature |
uRISetQueryFromForm
data URISetQueryFromFormMethodInfo Source
((~) * signature (Map Text Text -> m ()), MonadIO m) => MethodInfo * URISetQueryFromFormMethodInfo URI signature |
uRISetScheme
data URISetSchemeMethodInfo Source
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * URISetSchemeMethodInfo URI signature |
uRISetScheme :: MonadIO m => URI -> Text -> m () Source
uRISetUser
data URISetUserMethodInfo Source
((~) * signature (Maybe Text -> m ()), MonadIO m) => MethodInfo * URISetUserMethodInfo URI signature |
uRIToString
data URIToStringMethodInfo Source
((~) * signature (Bool -> m Text), MonadIO m) => MethodInfo * URIToStringMethodInfo URI signature |
uRIUsesDefaultPort
data URIUsesDefaultPortMethodInfo Source
((~) * signature (m Bool), MonadIO m) => MethodInfo * URIUsesDefaultPortMethodInfo URI signature |
uRIUsesDefaultPort :: MonadIO m => URI -> m Bool Source
Properties
Fragment
uRIClearFragment :: MonadIO m => URI -> m () Source
uRIFragment :: AttrLabelProxy "fragment" Source
uRIWriteFragment :: MonadIO m => URI -> CString -> m () Source
Host
uRIClearHost :: MonadIO m => URI -> m () Source
uRIHost :: AttrLabelProxy "host" Source
uRIWriteHost :: MonadIO m => URI -> CString -> m () Source
Password
uRIClearPassword :: MonadIO m => URI -> m () Source
uRIPassword :: AttrLabelProxy "password" Source
uRIWritePassword :: MonadIO m => URI -> CString -> m () Source
Path
uRIClearPath :: MonadIO m => URI -> m () Source
uRIPath :: AttrLabelProxy "path" Source
uRIWritePath :: MonadIO m => URI -> CString -> m () Source
Port
uRIPort :: AttrLabelProxy "port" Source
uRIReadPort :: MonadIO m => URI -> m Word32 Source
uRIWritePort :: MonadIO m => URI -> Word32 -> m () Source
Query
uRIClearQuery :: MonadIO m => URI -> m () Source
uRIQuery :: AttrLabelProxy "query" Source
uRIWriteQuery :: MonadIO m => URI -> CString -> m () Source
Scheme
uRIClearScheme :: MonadIO m => URI -> m () Source
uRIScheme :: AttrLabelProxy "scheme" Source
uRIWriteScheme :: MonadIO m => URI -> CString -> m () Source
User
uRIClearUser :: MonadIO m => URI -> m () Source
uRIUser :: AttrLabelProxy "user" Source
uRIWriteUser :: MonadIO m => URI -> CString -> m () Source