Mercurial > urweb
diff tests/headers.ur @ 1465:2f5fd248588d
getHeader and setHeader
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 29 May 2011 14:29:26 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/headers.ur Sun May 29 14:29:26 2011 -0400 @@ -0,0 +1,11 @@ +fun action () = + setHeader (blessResponseHeader "Location") "http://www.google.com/"; + return <xml/> + +fun main () = + ag <- getHeader (blessRequestHeader "User-Agent"); + return <xml><body> + User agent: {[ag]} + + <form> <submit action={action}/> </form> + </body></xml>