cabal-install-3.10.3.0: The command-line interface for Cabal and Hackage.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.HttpUtils

Description

Separate module for HTTP actions, using a proxy server if one exists.

Synopsis

Documentation

data HttpTransport Source #

Constructors

HttpTransport 

Fields

  • getHttp :: Verbosity -> URI -> Maybe ETag -> FilePath -> [Header] -> IO (HttpCode, Maybe ETag)

    GET a URI, with an optional ETag (to do a conditional fetch), write the resource to the given file and return the HTTP status code, and optional ETag.

  • postHttp :: Verbosity -> URI -> String -> Maybe Auth -> IO (HttpCode, String)

    POST a resource to a URI, with optional auth (username, password) and return the HTTP status code and any redirect URL.

  • postHttpFile :: Verbosity -> URI -> FilePath -> Maybe Auth -> IO (HttpCode, String)

    POST a file resource to a URI using multipart/form-data encoding, with optional auth (username, password) and return the HTTP status code and any error string.

  • putHttpFile :: Verbosity -> URI -> FilePath -> Maybe Auth -> [Header] -> IO (HttpCode, String)

    PUT a file resource to a URI, with optional auth (username, password), extra headers and return the HTTP status code and any error string.

  • transportSupportsHttps :: Bool

    Whether this transport supports https or just http.

  • transportManuallySelected :: Bool

    Whether this transport implementation was specifically chosen by the user via configuration, or whether it was automatically selected. Strictly speaking this is not a property of the transport itself but about how it was chosen. Nevertheless it's convenient to keep here.

downloadURI Source #

Arguments

:: HttpTransport 
-> Verbosity 
-> URI

What to download

-> FilePath

Where to put it

-> IO DownloadResult 

isOldHackageURI :: URI -> Bool Source #

Utility function for legacy support.