有没有办法将环的参数哈希映射转换为浏览器和服务器用于通信的原始响应和请求标头?
所以基本上,我希望能够使用 ring 生成和解析原始文本标题,而不是 ring 提供的哈希映射结构。
要求:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:__qca=P0-1122510804-1338534864474; usr=t=pvgxSE5uUO9s&s=Ir7otYoeUaMb; __utma=140029553.119380626.1338534864.1340057197.1340064637.52; __utmb=140029553.6.10.1340064637; __utmc=140029553; __utmz=140029553.1340000628.50.23.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
回复:
Host:stackoverflow.com
If-Modified-Since:Tue, 19 Jun 2012 00:10:35 GMT
Referer:http://stackoverflow.com/posts/11092804/edit
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.34 Safari/536.11
Response Headersview source
Cache-Control:public, max-age=60
Content-Encoding:gzip
Content-Length:33233
Content-Type:text/html; charset=utf-8
Date:Tue, 19 Jun 2012 00:26:48 GMT
Expires:Tue, 19 Jun 2012 00:27:48 GMT
Last-Modified:Tue, 19 Jun 2012 00:26:48 GMT
Set-Cookie:usr=t=Qz5ObGDYskmu&s=Ir7otYoeUaMb; domain=.stackoverflow.com; expires=Wed, 19-Dec-2012 00:26:48 GMT; path=/; HttpOnly
Vary:*