方式一、
发送:
wget_new 192.168.9.41:1234
服务器收到:
方式二、
发送:
wget_new --header=“User-Agents: Chrome” 192.168.9.41:1234
服务器收到
方式三、
发送
wget_new --header=“User-Agents: Chrome” --header=“Content-Type: Application/json” 192.168.9.41:1234
服务器收到
方式四、
发送
wget_new --header=“User-Agents: Chrome” --header=“Content-Type: Application/json” --post-data=‘{“name”:“guojintao”}’ 192.168.9.41:1234
服务器收到
方式五、
发送
wget_new --header=“User-Agents: Chrome” --header=“Content-Type: Application/json” --post-data=‘{“name”:“guojintao”}’ 192.168.9.41:1234/aaa
服务器收到
方式六、
发送(具有超时和重试次数设置)
wget_new -t 1 -T 3 --header=“User-Agents: Chrome” --header=“Content-Type: Application/json” --post-data=‘{“name”:“guojintao”}’ 192.168.9.41:1234/aaa
服务器收到
通过方式二至六的发送数据可知,wget 可以按用于发送post -json数据文件
方式七、
wget_new -O /dev/shm/pic3 -T 3 --http-user=admin --http-password=a1234567 http://192.168.9.67:80/ISAPI/Streaming/channels/101/picture
收到:/dev/shm/pic3 方件,此方件就是摄像头照片
方式八、
aaa文件中内容为12345
发送
wget_new --header=“User-Agents: Chrome” --header=“Cont Application/json” --post-file aaa 192.168.9.41:1234
此时服务器收到:
12345
POST / HTTP/1.1
User-Agent: Wget/1.21
Accept: /
Accept-Encoding: identity
Host: 192.168.9.41:1234
Connection: Keep-Alive
Content-Type: Application/json
Content-Length: 6
User-Agents: Chrome
12345
由此证明–post-file 可以上传文件内容。