# Http Request **Repository Path**: heiing-ops/http-request ## Basic Information - **Project Name**: Http Request - **Description**: 一个请求HTTP的客户端工具,可用于调试 HTTP 协议 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-22 - **Last Updated**: 2023-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HTTP 请求 发起 HTTP 请求,查看 HTTP 报文。 用法: ```bash http-request url [tcp-addr] ``` 参数说明: - url:【必需】 HTTP 或 HTTPS 的 URL,如 https://example.com - tcp-addr:【可选】实际连接的 TCP 地址(host 或 host:port),如 127.0.0.1, 127.0.0.1:8080 如果不提供 tcp-addr ,则使用 url 中的 host 或 host:port 地址来连接服务器。 端口可以省略,如果省略端口,则使用 url 中的协议模式(scheme)来选择端口。 url 参数中的 host 或 host:port 作为 HTTP 消息头中的 Host 字段的值。 示例: ```bash # 先解析域名的 IP 地址,再连接 IP:80,发起请求 Host: example.com http-request https://example.com # 直接连接 127.0.0.1:8080,发起请求 Host: 127.0.0.1:8080 http-request http://127.0.0.1:8080 # 先解析域名的 IP 地址,再连接 IP:8080,发起请求 Host: example.com:8080 http-request http://example.com:8080 # 直接连接 127.0.0.1:443,发起请求 Host: example.com http-request https://example.com 127.0.0.1 # 直接连接 127.0.0.1:80,发起请求 Host: 127.0.0.1:8080 http-request http://127.0.0.1:8080 127.0.0.1 # 直接连接 127.0.0.1:9090,发起请求 Host: example.com:8080 http-request http://example.com:8080 127.0.0.1:9090 ```