module Network.HTTP.Lucu.Response ( StatusCode(..) , Response(..) ) where import qualified Data.ByteString.Lazy.Char8 as B import Data.ByteString.Lazy.Char8 (ByteString) import Network.HTTP.Lucu.Headers import Network.HTTP.Lucu.HttpVersion data StatusCode = Continue | SwitchingProtocols | Processing -- | Ok | Created | Accepted | NonAuthoritativeInformation | NoContent | ResetContent | PartialContent | MultiStatus -- | MultipleChoices | MovedPermanently | Found | SeeOther | NotModified | UseProxy | TemporaryRedirect -- | BadRequest | Unauthorized | PaymentRequired | Forbidden | NotFound | MethodNotAllowed | NotAcceptable | ProxyAuthenticationRequired | RequestTimeout | Conflict | Gone | LengthRequired | PreconditionFailed | RequestEntityTooLarge | RequestURITooLarge | UnsupportedMediaType | RequestRangeNotSatisfiable | ExpectationFailed | UnprocessableEntitiy | Locked | FailedDependency -- | InternalServerError | NotImplemented | BadGateway | ServiceUnavailable | GatewayTimeout | HttpVersionNotSupported | InsufficientStorage data Response = Response { resVersion :: HttpVersion , resStatus :: StatusCode , resHeaders :: Headers , resBody :: Maybe ByteString } instance HasHeaders Response where getHeaders = resHeaders setHeaders res hdr = res { resHeaders = hdr }