命令 nc
捕获 HTTP 请求的内容
- 监听端口,用于捕获数据。
nc -l port
- 发送 HTTP 请求。
curl http://ip:port/
GET 请求
curl http://127.0.0.1:8000/
GET /?name=wjj HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: curl/7.61.1
Accept: */*
POST JSON 请求
curl --location --request POST 'http://127.0.0.1:8000/users_by_json' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "wjj",
"age": 40
}'
POST /users_by_json HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: curl/7.61.1
Accept: */*
Content-Type: application/json
Content-Length: 36
{
"name": "wjj",
"age": 40
}


