加入收藏
举报
当前仅显示指定条件回帖 [ 展开查看全部 ]
02-07 19:42
#
文件名称:
11.12.md
所在目录:
深入了解计算机系统(CSAPP) / csapp课后题答案 / chapter11
文件大小:
1.00 KB
下载地址:
richardodliu/HIT-Courses
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
11.12
run server
(cd chapter11/code; make && ./tiny.12 5000)
visit `http://localhost:5000/post-home.html` and submit
POST method pass param by message-body behind Headers part.
When we input 9 and 10 and submit, socket pass content
POST /cgi-bin/post-adder HTTP/1.1
Host: localhost:5000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 16
Referer: http://localhost:5000/post-home.html
Cookie: _ga=GA1.1.1286836072.1494744693
Connection: keep-alive
Upgrade-Insecure-Requests: 1
(CRLF here, message-body below)
first=9&second=10
Content-Length marks the length of message-body.
use `readnb` to fetch post param.
```diff
!INCLUDE "./code/tiny.12.c.diff"
```
post-adder code
```c
!INCLUDE "./code/cgi-bin/post-adder.c"
```
点赞 回复
回帖
支持markdown部分语法 ?