InternetLib

¤ HttpRequest, HttpResponse, et al

HTTP related types

Types

data HttpRequest a = HttpReq { reqURI :: a, reqMethod :: HttpMethod, reqHdrs :: HttpHeaders }
data HttpResponse = HttpResp { respCode :: Int, respMsg :: String, respHdrs :: HttpHeaders, respBody :: String }
data HttpMethod = HttpGet | HttpHead | HttpPost String
  instance Eq HttpMethod
  instance Show HttpMethod
type HttpHeaders = Headers
type Headers = [(String, String)]

These types represent the messages defined in the HTTP protocol. A web client (a browser) sends a HttpRequest to a web server, which replies with a HttpResponse.

See Also

A fudget for fetching documents using the HTTP protocol (i.e., creating web clients): urlFetchF.

A fudget for creating web servers: simpleHttpServer.

Functions for creating HttpResponse values: okResponse et al.

The HTTP protocol: Hypertext Transfer Protocol -- HTTP/1.0.

More HTTP information: HTTP Specifications and Drafts.


InternetLib