packages feed

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">&nbsp;</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> &#8759; ByteString &#8594; ByteString</li><li class="src short"><a href="#v:breakBS">breakBS</a> &#8759; ByteString &#8594; ByteString &#8594; (ByteString, ByteString)</li><li class="src short"><a href="#v:fallback">fallback</a> &#8759;  Maybe a &#8594; a &#8594; a</li><li class="src short"><a href="#v:parseBody">parseBody</a> &#8759; ByteString &#8594; [(ByteString, ByteString)]</li><li class="src short"><a href="#v:sendReply">sendReply</a> &#8759; Socket &#8594; Int &#8594; [(ByteString, [ByteString])] &#8594; ByteString &#8594; IO ()</li><li class="src short"><a href="#v:sendBadRequest">sendBadRequest</a> &#8759; Socket &#8594; IO ()</li><li class="src short"><a href="#v:sendNotFound">sendNotFound</a> &#8759; Socket &#8594; IO ()</li><li class="src short"><a href="#v:statusMsg">statusMsg</a> &#8759; Int &#8594; ByteString</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:trim" class="def">trim</a> &#8759; ByteString &#8594; 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> &#8759; ByteString &#8594; ByteString &#8594; (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> &#8759;  Maybe a &#8594; a &#8594; a</p></div><div class="top"><p class="src"><a name="v:parseBody" class="def">parseBody</a> &#8759; ByteString &#8594; [(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">&#8759; Socket</td><td class="doc"><p>Socket to write to
</p></td></tr><tr><td class="src">&#8594; Int</td><td class="doc"><p>Status Code to send
</p></td></tr><tr><td class="src">&#8594; [(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">&#8594; ByteString</td><td class="doc"><p>Body
</p></td></tr><tr><td class="src">&#8594; IO ()</td><td class="doc empty">&nbsp;</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> &#8759; Socket &#8594; 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> &#8759; Socket &#8594; 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">&#8759; Int</td><td class="doc"><p>Status code (ex. 404)
</p></td></tr><tr><td class="src">&#8594; 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>