From 446602fe336ad1c2a23e3d50d7cd1d1356fcc9de Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Thu, 26 Nov 2020 13:55:55 +0400 Subject: Initial commit --- Response.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Response.hs (limited to 'Response.hs') diff --git a/Response.hs b/Response.hs new file mode 100644 index 0000000..f33777d --- /dev/null +++ b/Response.hs @@ -0,0 +1,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 \ No newline at end of file -- cgit v1.2.3