Ketchup-0.3: docs/Ketchup-Utils.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Utils</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Ketchup-Utils.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Utils</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:trim">trim</a> ∷ ByteString → ByteString</li><li class="src short"><a href="#v:breakBS">breakBS</a> ∷ ByteString → ByteString → (ByteString, ByteString)</li><li class="src short"><a href="#v:fallback">fallback</a> ∷ Maybe a → a → a</li><li class="src short"><a href="#v:parseBody">parseBody</a> ∷ ByteString → [(ByteString, ByteString)]</li><li class="src short"><a href="#v:sendReply">sendReply</a> ∷ Socket → Int → [(ByteString, [ByteString])] → ByteString → IO ()</li><li class="src short"><a href="#v:sendBadRequest">sendBadRequest</a> ∷ Socket → IO ()</li><li class="src short"><a href="#v:sendNotFound">sendNotFound</a> ∷ Socket → IO ()</li><li class="src short"><a href="#v:statusMsg">statusMsg</a> ∷ Int → ByteString</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:trim" class="def">trim</a> ∷ ByteString → ByteString</p><div class="doc"><p>Trim whitespace from headers
</p></div></div><div class="top"><p class="src"><a name="v:breakBS" class="def">breakBS</a> ∷ ByteString → ByteString → (ByteString, ByteString)</p><div class="doc"><p>ByteString breakSubstring wrapper that drops delimiters
</p></div></div><div class="top"><p class="src"><a name="v:fallback" class="def">fallback</a> ∷ Maybe a → a → a</p></div><div class="top"><p class="src"><a name="v:parseBody" class="def">parseBody</a> ∷ ByteString → [(ByteString, ByteString)]</p><div class="doc"><p>Parse a URL-encoded Request
</p></div></div><div class="top"><p class="src"><a name="v:sendReply" class="def">sendReply</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ Socket</td><td class="doc"><p>Socket to write to
</p></td></tr><tr><td class="src">→ Int</td><td class="doc"><p>Status Code to send
</p></td></tr><tr><td class="src">→ [(ByteString, [ByteString])]</td><td class="doc"><p>HTTP headers (<a href="Header.html">Header</a>,[<a href="value1.html">value1</a>, <a href="value2.html">value2</a>])
</p></td></tr><tr><td class="src">→ ByteString</td><td class="doc"><p>Body
</p></td></tr><tr><td class="src">→ IO ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Send a HTTP reply
Sends a reply with the given parameters
</p></div></div><div class="top"><p class="src"><a name="v:sendBadRequest" class="def">sendBadRequest</a> ∷ Socket → IO ()</p><div class="doc"><p>Send 400 Bad Request error
</p></div></div><div class="top"><p class="src"><a name="v:sendNotFound" class="def">sendNotFound</a> ∷ Socket → IO ()</p><div class="doc"><p>Send 404 Not Found error
</p></div></div><div class="top"><p class="src"><a name="v:statusMsg" class="def">statusMsg</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ Int</td><td class="doc"><p>Status code (ex. 404)
</p></td></tr><tr><td class="src">→ ByteString</td><td class="doc"><p>Status message (ex. <a href="404 Not Found.html">404 Not Found</a>)
</p></td></tr></table></div><div class="doc"><p>Status Messages
Returns status message from a given status id
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>