ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

实用的curl命令整理

2022-02-07 23:33:25  阅读:225  来源: 互联网

标签:Content http 20.242 实用 124.222 2022 整理 curl GMT


1.绑定固定IP和端口http请求测试及响应。

kevin@192 GitHubOfkevinsu % curl -I "http://static.kivensu.club/" -x 124.222.20.242:80
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 07 Feb 2022 14:38:54 GMT
Content-Type: text/html
Content-Length: 30
Last-Modified: Thu, 27 Jan 2022 10:29:28 GMT
Connection: keep-alive
ETag: "61f27408-1e"
Accept-Ranges: bytes

2.绑定固定IP和端口http请求测试及响应过程。

kevin@192 GitHubOfkevinsu % curl -v "http://static.kivensu.club/" -x 124.222.20.242:80
*   Trying 124.222.20.242:80...
* Connected to 124.222.20.242 (124.222.20.242) port 80 (#0)
> GET http://static.kivensu.club/ HTTP/1.1
> Host: static.kivensu.club
> User-Agent: curl/7.77.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 07 Feb 2022 14:42:13 GMT
< Content-Type: text/html
< Content-Length: 30
< Last-Modified: Thu, 27 Jan 2022 10:29:28 GMT
< Connection: keep-alive
< ETag: "61f27408-1e"
< Accept-Ranges: bytes
<
Welcome to My home!EveryBody.
* Connection #0 to host 124.222.20.242 left intact

3.耗时。

kevin@192 GitHubOfkevinsu % curl --trace-ascii output.txt --trace-time "http://static.kivensu.club/"
Welcome to My home!EveryBody.
kevin@192 GitHubOfkevinsu % ls
output.txt

4.指定UA。

kevin@192 GitHubOfkevinsu % curl -I "http://static.kivensu.club/" -x 124.222.20.242:80 --user-agent "Mozilla/5.0"
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 07 Feb 2022 14:47:46 GMT
Content-Type: text/html
Content-Length: 30
Last-Modified: Thu, 27 Jan 2022 10:29:28 GMT
Connection: keep-alive
ETag: "61f27408-1e"
Accept-Ranges: bytes

6.指定cookie文件。

kevin@192 GitHubOfkevinsu % curl -I "http://static.kivensu.club/" -x 124.222.20.242:80 --cookie-jar cookie_file
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 07 Feb 2022 14:49:52 GMT
Content-Type: text/html
Content-Length: 30
Last-Modified: Thu, 27 Jan 2022 10:29:28 GMT
Connection: keep-alive
ETag: "61f27408-1e"
Accept-Ranges: bytes

7.Post传参请求。

kevin@192 GitHubOfkevinsu % curl "http://static.kivensu.club/" -x 124.222.20.242:80 -H "Content-Type:application/json" -X Post -d '{"id":1,"name":"admin"}'
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

8.Range分片请求。

kevin@192 GitHubOfkevinsu % curl -v "http://static.kivensu.club/" -x 124.222.20.242:80 -r 0-6
*   Trying 124.222.20.242:80...
* Connected to 124.222.20.242 (124.222.20.242) port 80 (#0)
> GET http://static.kivensu.club/ HTTP/1.1
> Host: static.kivensu.club
> Range: bytes=0-6
> User-Agent: curl/7.77.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 206 Partial Content
< Server: nginx
< Date: Mon, 07 Feb 2022 14:55:46 GMT
< Content-Type: text/html
< Content-Length: 7
< Last-Modified: Thu, 27 Jan 2022 10:29:28 GMT
< Connection: keep-alive
< ETag: "61f27408-1e"
< Content-Range: bytes 0-6/30
<
* Connection #0 to host 124.222.20.242 left intact
Welcome%

9.绑定IP+固定端口https请求测试访问。

kevin@192 GitHubOfkevinsu % curl -sv "https://124.222.20.242:8904" -k
*   Trying 124.222.20.242:8904...
* Connected to 124.222.20.242 (124.222.20.242) port 8904 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=static.kivensu.club
*  start date: Feb  7 00:00:00 2022 GMT
*  expire date: Feb  7 23:59:59 2023 GMT
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=Encryption Everywhere DV TLS CA - G1
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: 124.222.20.242:8904
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 07 Feb 2022 15:12:30 GMT
< Content-Type: text/html
< Content-Length: 46
< Last-Modified: Mon, 07 Feb 2022 07:47:40 GMT
< Connection: keep-alive
< ETag: "6200ce9c-2e"
< Accept-Ranges: bytes
<
This is https test page!
So Please attention!
* Connection #0 to host 124.222.20.242 left intact

标签:Content,http,20.242,实用,124.222,2022,整理,curl,GMT
来源: https://www.cnblogs.com/jason007/p/15869798.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有