req-url-extra-0.1.0.0: Provides URI/URL helper functions for use with Req

Copyright(C) Richard Cook 2018
LicenseMIT
Maintainerrcook@rcook.org
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.HTTP.Req.Url.Extra

Description

This package provides helper functions to make working with Url from Req easier.

Synopsis

Documentation

toUrlHttp Source #

Arguments

:: URI

URI

-> Maybe (Url Http, Option scheme)

Combination of Url and Option, Nothing on failure

toUrlHttp converts an instance of URI to an instance of Url and Option. If the URI is not a valid http URI, then this function will return Nothing.

This function parses scheme, host and path, returned as part of Url, and optional query parameters, returned in Option. It does not parse method name or authentication info from the given URI.

toUrlHttps Source #

Arguments

:: URI

URI

-> Maybe (Url Https, Option scheme)

Combination of Url and Option, Nothing on failure

toUrlHttp converts an instance of URI to an instance of Url and Option. If the URI is not a valid https URI, then this function will return Nothing.

This function parses scheme, host and path, returned as part of Url, and optional query parameters, returned in Option. It does not parse method name or authentication info from the given URI.