simpleHTTP

Download the specified URL, following any redirects, and return the response body. This function will throwIO an HttpException for any response with a non-2xx status code (besides 3xx redirects up to a limit of 10 redirects). It uses parseUrlThrow to parse the input. This function essentially wraps httpLbs. Note: Even though this function returns a lazy bytestring, it does not utilize lazy I/O, and therefore the entire response body will live in memory. If you want constant memory usage, you'll need to use the conduit package and http directly. Note: This function creates a new Manager. It should be avoided in production code.
simpleHTTP req transmits the Request req by opening a direct, non-persistent connection to the HTTP server that req is destined for, followed by transmitting it and gathering up the response as a Result. Prior to sending the request, it is normalized (via normalizeRequest). If you have to mediate the request via an HTTP proxy, you will have to normalize the request yourself. Or switch to using Browser instead. Examples:
simpleHTTP (getRequest "http://hackage.haskell.org/")
simpleHTTP (getRequest "http://hackage.haskell.org:8012/")
simpleHTTP transmits a resource across a non-persistent connection.
Simple way to transmit a resource across a non-persistent connection.
start the server, and handle requests using the supplied ServerPart. This function will not return, though it may throw an exception. NOTE: The server will only listen on IPv4 due to portability issues in the Network module. For IPv6 support, use simpleHTTPWithSocket with custom socket.
simpleHTTP is a self-contained HTTP server which can be used to run a ServerPart. A very simple, "Hello World!" web app looks like:
import Happstack.Server
main = simpleHTTP nullConf $ ok "Hello World!"
By default the server will listen on port 8000. Run the app and point your browser at: http://localhost:8000/ For FastCGI support see: http://hackage.haskell.org/package/happstack-fastcgi
Identical to simpleHTTP, but acting on an already opened stream.
Like simpleHTTP, but acting on an already opened stream.
simpleHTTP_debug debugFile req behaves like simpleHTTP, but logs the HTTP operation via the debug file debugFile.
Like simpleHTTP, but acting on an already opened stream.
A combination of simpleHTTP'' and mapServerPartT. See mapServerPartT for a discussion of the first argument of this function. NOTE: This function always binds to IPv4 ports until Network module is fixed to support IPv6 in a portable way. Use simpleHTTPWithSocket with custom socket if you want different behaviour.
Generate a result from a ServerPartT and a Request. This is mainly used by CGI (and fast-cgi) wrappers.
Run simpleHTTP with a previously bound socket. Useful if you want to run happstack as user on port 80. Use something like this:
import System.Posix.User (setUserID, UserEntry(..), getUserEntryForName)

main = do
let conf = nullConf { port = 80 }
socket <- bindPort conf
-- do other stuff as root here
getUserEntryForName "www" >>= setUserID . userID
-- finally start handling incoming requests
tid <- forkIO $ simpleHTTPWithSocket socket Nothing conf impl
Note: It's important to use the same conf (or at least the same port) for bindPort and simpleHTTPWithSocket. see also: bindPort, bindIPv4
Like simpleHTTP' with a socket.
Starts serving HTTP requests using the given handler. This function never returns; to shut down the HTTP server, kill the controlling thread. This function is like httpServe except it doesn't setup compression, reverse proxy address translation (via behindProxy), or the error handler; this allows it to be used from MonadSnap.
start the https:// server, and handle requests using the supplied ServerPart. This function will not return, though it may throw an exception.
similar simpleHTTPS but allows you to supply a function to convert m to IO.