Lucu-1.0: Embedded HTTP Server

Network.HTTP.Lucu.Response

Description

Definition of HTTP responses.

Synopsis

Documentation

data Response Source

This is the definition of an HTTP response.

Instances

Eq Response 
Show Response 
HasHeaders Response 
ConvertSuccess Response Ascii 
ConvertSuccess Response AsciiBuilder 
ConvertAttempt Response Ascii 
ConvertAttempt Response AsciiBuilder 

emptyResponse :: StatusCode sc => sc -> ResponseSource

Returns an HTTP/1.1 Response with no header fields.

setStatusCode :: StatusCode sc => sc -> Response -> ResponseSource

setStatusCode sc res sets the status code of res to sc.

resCanHaveBody :: Response -> BoolSource

Returns True iff a given Response allows the existence of response entity body.

isInformational :: StatusCode sc => sc -> BoolSource

isInformational sc returns True iff sc < 200.

isSuccessful :: StatusCode sc => sc -> BoolSource

isSuccessful sc returns True iff 200 <= sc < 300.

isRedirection :: StatusCode sc => sc -> BoolSource

isRedirection sc returns True iff 300 <= sc < 400.

isError :: StatusCode sc => sc -> BoolSource

isError sc returns True iff 400 <= sc

isClientError :: StatusCode sc => sc -> BoolSource

isClientError sc returns True iff 400 <= sc < 500.

isServerError :: StatusCode sc => sc -> BoolSource

isServerError sc returns True iff 500 <= sc.