tiny server升级版本 浅析
代码来源在此:来源
试玩界面
未完成
post表单界面
如果根据以上返回 构造post
尝试 curl post
noya@noya-VirtualBox:/media/sda_m/socketHome/tiny_server-Update/Tiny_process$ curl -d "add_num1=10&add_num2=20" "localhost:12345/add.html"
<html><title>Tiny Error</title><body bgcolor=ffffff>
403: Forbidden
<p>Tiny couldn't run the CGI program: ./add.html
<hr><em>The Tiny Web server</em>
curl html加上参数
rl "localhost:12345/add.html?10&36"
<html><title>Tiny Error</title><body bgcolor=ffffff>
404: Not found
<p>Tiny couldn't find this file: ./add.html?10&36
<hr><em>The Tiny Web server</em>
柳暗花明
抓取现场 tcpdump 抓post
thanks
tcpdump to capture post
the command is
sudo tcpdump -i lo -s 0 -A -vv 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354'
when I click the web button ,I got the post content
curl 命令行重现
post方式
curl -d "add_num1=10&add_num2=20" "localhost:12345/cgi-bin/adder"
或者换种形式是:
curl "localhost:12345/cgi-bin/adder?7&8"
todo
不知道通过 *.html等文本是否可以带参数,当前尝试,作为文件名里面去了
不懂submit这个键对应到代码的
小节
一个支持 get post等的http server
一个支持 多路io的server(todo)
一个调试 post等报文的方法
一种curl 启动post的方法
如何server /client联调