
Tengo algunas solicitudes HTTP en formato sin formato, como
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)
Tengo que probarlos y depurarlos por esta razón. Necesito una manera fácil de repetirlos en mi computadora. ¿Cómo puedo realizar una solicitud HTTP a partir de datos sin procesar usando curl
u httpie
otro cliente CLI HTTP?
Respuesta1
Sugiero telnet: telnet www.nowhere123.com 80
y estás hablando sin formato con el servidor.
Ejemplo:
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.