title: python socket bad request 400
body: <p>I run my program which is used to request a text file on a website, using python(2.7.6) socket.</p>
  <pre><code>import socket
  s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  h='58.68.237.xxx'
  p=80
  s.connect((h,p))
  m='GET / HTTP/1.1\r\n\r\n'
  s.sendall(m)
  r=s.recv(4096)
  print r
  </code></pre>
  <p>And, I got the output:</p>
  <pre><code>HTTP/1.1 400 Bad Request\r\n
  Date: Mon, 13 Oct 2014 02:46:15 GMT\r\n
  Server: Apache/2.2.3 (CentOS)\r\n
  Content-Length: 300\r\nConnection: close\r\n
  Content-Type: text/html; charset=iso-8859-1\r\n
  \r\n
  &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0 //EN&quot;&gt;\n
  &lt;html&gt;&lt;head&gt;\n
  &lt;title&gt;400 Bad Request&lt;/title&gt;\n
  &lt;/head&gt;&lt;body&gt;\n
  &lt;h1&gt;Bad Request&lt;/h1&gt;\n
  &lt;p&gt;Your browser sent a request that this server could not understand.&lt;br/&gt;\n
  &lt;/p&gt;\n&lt;hr&gt;\n
  &lt;address&gt;Apache/2.2.3 (CentOS) Server at 127.0.0.1 Port 80&lt;/address&gt;\n
  &lt;/body&gt;&lt;/html&gt;\n
  </code></pre>
  <p><em>Question:</em>
  What is wrong in my code?
  How can I fix it for a good request?</p>