IT練習ノート

IT関連で調べたこと(実際は嵌ったこと)を書いています。

waiでのrequestの処理

waiでrequestの基本的な使い方を確認するサンプル。

wai_hello.hs

wai_index.html

*Main> main
start app function ====================================
requestMethod  : GET
secure         : False
rawPathInfo    : /cgi.php
rawQueryString : ?foo=1111
requestHeaders : 
host : 127.0.0.1:3030
accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language : ja-jp
connection : keep-alive
accept-encoding : gzip, deflate
user-agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4
queryString    : 
foo : 1111
start app function ====================================
requestMethod  : POST
secure         : False
rawPathInfo    : /cgi.php
rawQueryString : ?foo=111&bar=222
requestHeaders : 
host : 127.0.0.1:3030
content-type : application/x-www-form-urlencoded
origin : file://
connection : keep-alive
accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
user-agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4
accept-language : ja-jp
accept-encoding : gzip, deflate
content-length : 7
queryString    : 
foo : 111
bar : 222