[RqData: update queryString / body to not refer to things from the next section Jeremy Shaw **20101020012201 Ignore-this: 5e64171058c3e3faca449bec25db8df6 ] hunk ./RqDataError.lhs 55 -

But if we leave off the query parameters we get http://localhost:8000/, we will get a list of errors: +

But if we leave off the query parameters http://localhost:8000/, we will get a list of errors: hunk ./RqDataLimiting.lhs 16 -> body :: RqData a -> RqData a -> queryString :: RqData a -> RqData a +> body :: (HasRqData m) => m a -> m a +> queryString :: (HasRqData m) => m a -> m a hunk ./RqDataLimiting.lhs 21 -

If we want to only look in the request body we could modified helloRq to be:

+

Using these filters we can modify helloPart so that the greeting must come from the QUERY_STRING and the noun must come from the request body:

hunk ./RqDataLimiting.lhs 25 -> helloRq :: RqData (String, String) -> helloRq = -> body ((,) <$> look "greeting" <*> look "noun") -#endif - - -

In that example, we apply a single body filter which -applies to all of the look calls. But, we could also mix -and match. In this varation we look in the QUERY_STRING for the -greeting and the request body for the noun

- -
-#ifdef HsColour -> helloRq :: RqData (String, String) -> helloRq = -> (,) <$> (queryString $ look "greeting") <*> (body $ look "noun") +> helloPart :: ServerPart String +> helloPart = +> do greeting <- queryString $ look "greeting" +> noun <- body $ look "noun" +> ok $ greeting ++ ", " ++ noun hunk ./RqDataLimiting.lhs 39 -> helloRq :: RqData (String, String) -> helloRq = +> greetingRq :: ServerPart String +> greetingRq = hunk ./RqDataLimiting.lhs 45 -

This RqData would never match anything because the +

This code would never match anything because the