生データからHTTPリクエストを作成する方法は?

生データからHTTPリクエストを作成する方法は?

raw形式のHTTPリクエストがあります。

GET /docs/index.html HTTP/1.1
Host: www.nowhere123.com
Accept: image/gif, image/jpeg, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
(blank line)

これをテストしてデバッグする必要があり、そのため、自分のコンピュータでこれを繰り返す簡単な方法が必要です。または、他のCLI HTTPクライアントを使用して生データからHTTPcurl要求を作成する方法はhttpie

ベストアンサー1

私はTelnetを提案します:telnet www.nowhere123.com 80そしてあなたはサーバーとの生の会話を共有しています。

例:

telnet 127.0.0.1 80

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

GET /index.htm

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https:///index.htm">here</a>.</p>
</body></html>
Connection closed by foreign host.

おすすめ記事