Snap automatically decodes the request and makes it available to you through the Request data type. It provides the getRequest and withRequest functions to retrieve the request and a number of other access functions to receive various parts.
There are also convenient features for general operations. To get the POST or GET parameter, see getParam .
Snap gives it to you as ByteString, because this API is at a fairly low level of abstraction, leaving the user with how to handle things like text encoding. I would recommend using a much more efficient Text type instead of String. The Readable class also provides a mechanism to eliminate some patterns of these transformations. The default instances for numbers and text assume UTF8 encoding.
mightybyte
source share