想测试一下 http 的幕后发生了什么,所以我做了这样的事情:
socket = TCPSocket.open('localhost',4567)
request = "GET / HTTP/1.1\r\nHost:localhost\r\n\r\n"
socket.print request
但是 sinatra 给了我一个错误:
[2012-08-01 14:04:11] ERROR bad Request-Line `'.
ec2-184-169-164-27.us-west-1.compute.amazonaws.com - - [01/Aug/2012:14:04:11 UTC] "" 400 313
- ->
任何想法?