title: Get data using python sockets from firebase
body: <p>I'm trying to access my database on Firebase using the sockets library instead of the python requests library. Bellow I have a simple example that returns</p>
  
  <pre><code>b'Invalid Firebase Request'
  Time 0.10938119888305664
  </code></pre>
  
  <p>I'm mostly trying to reduce the latency between my client ('which should post not get') and the fire base server</p>
  
  <pre><code>import socket
  import ssl
  import time
  import requests
  
  
  
  HOST = '&lt;my database link&gt;.firebaseio.com'  
  PORT = 443    
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
      ss = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
      ss.connect((HOST, PORT))
      for i in range(1):
          ts = time.time()    
          request = "GET /&lt;A database child&gt;.json \nHost: "+ HOST+"\n\n"
          ss.send(request.encode())
          result = ss.recv(4096)
          #print (result)
          while (len(result)&gt;0):
              print (result)
              result = ss.recv(4096)
          print ('Time '+ str(time.time()-ts))
  </code></pre>
  
  <p>also when I increase the range above 1 the program doesn't make multiple requests. why is this?</p>