summaryrefslogtreecommitdiff
path: root/Response.hs
blob: f33777db2f830c5f7e33aac5704827cd7ce16bac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Response where

data Response =
  HtmlResponse Int String -- Код возврата, содержимое HTML
  | TextResponse Int String String -- Код возврата, Content-Type, содержимое HTML


getStatusCode (HtmlResponse code _) = code
getStatusCode (TextResponse code _ _) = code

getContentType (HtmlResponse _ _) = "text/html"
getContentType (TextResponse _ contentType _) = contentType

getContent (HtmlResponse _ content) = content
getContent (TextResponse _ _ content) = content