linux curl

3 阅读1分钟

获取文件状态码 cmd = "/usr/bin/curl -I {apk_download__url} -o /dev/null -s -w %{http_code}."{$apk_download__url}\n " >> /data/log/youxi53/sdkadmin/check_apk/curl.log"; 选项 --vv 通信细节 --trace output.txt http请求包

文件上传 -F "advertiser_id=10031328"
-F "file_name=curl_file"
-F "file=@/root/curl_file.jpg"
-F "file_type=jpg" --compressed

指定ip -x 指定代理

curl 获取http状态码 curl -o /dev/null -s -w %{http_code} "www.kklinux.com"

获取头部信息 curl -I www.sina.com.cn/

post

curl -H 'Host:www.test.com'
-H "Content-Type:application/json" -X POST -d '{"log_time": "1528164583", "api":"login","gid":1,"sid":"s1","oldsid":"s1","user_id":"zhansan","role_id":"角色","part_id":1000,"time":"1528164583"}' http://47.100.14.234/post.php

//file_get_contents("php://input") 接收 curl

-d"log_time=1528164583&api=login&gid=1&sid=s1&oldsid=s1&user_id=zhangsan&role_id=角&part_id=1000&time=1528164583&ip=192.168.71.21&role_level=10&map_id=1&group_id=100&login_day=1&gold=10®_time=1528164583" "http://localhost:8081"

指定ip访问 ————————————————

                        版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
                    

原文链接:blog.csdn.net/qq_24700495…