title: Empty response from server when connecting with python socket
body: <p>I am trying to connect to URL <code>https://www.ssehl.co.uk/HALO/publicLogon.do</code> in Python.</p>
  
  <p>The simple solution using <code>requests</code> fails:</p>
  
  <pre><code>import requests
  r = requests.get('https://www.ssehl.co.uk/HALO/publicLogon.do')
  print r.text
  </code></pre>
  
  <p>with error </p>
  
  <pre><code>File "c:\Python27\lib\site-packages\requests\adapters.py", line 327, in send
  raise ConnectionError(e)
  requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.ssehl.co.uk', port=443): Max retries exceeded with url: /HALO/publicLogon.do (Caused by &lt;class 'httplib.BadStatusLine'&gt;: '')
  </code></pre>
  
  <p>so I tried to get the raw response from the server using library <code>socket</code>:</p>
  
  <pre><code>import socket   #for sockets
  import sys  #for exit
  
  #create an INET, STREAMing socket
  try:
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  except socket.error:
      print 'Failed to create socket'
      sys.exit()
  
  print 'Socket Created'
  host = 'www.ssehl.co.uk';
  port = 443;
  
  try:
      remote_ip = socket.gethostbyname(host)
  
  except socket.gaierror:
      #could not resolve
      print 'Hostname could not be resolved. Exiting'
      sys.exit()
  
  #Connect to remote server
  s.connect((remote_ip , port))
  
  print 'Socket Connected to ' + host + ' on ip ' + remote_ip
  
  #Send some data to remote server
  message = "GET /HALO/publicLogon.do HTTP/1.1\r\n\r\n"
  
  try :
     #Set the whole string
     s.sendall(message)
  except socket.error:
     #Send failed
     print 'Send failed'
     sys.exit()
  
  print 'Message send successfully'
  
  #Now receive data
  reply = s.recv(4096)
  
  print reply
  </code></pre>
  
  <p>will output:</p>
  
  <pre><code>Socket Created
  Socket Connected to www.ssehl.co.uk on ip 161.12.7.194
  Message send successfully
  Reply: 
  </code></pre>
  
  <p>after reply there is some garbage which I can't paste, however this is a sublime console screenshot:</p>
  
  <p><a href="http://i.imgur.com/obN9CTa.png" rel="nofollow">Screenshot</a></p>
  
  <p>Is there any way to get a 200 response from the server, just like a browser?</p>