Skip to content

Instantly share code, notes, and snippets.

@Torxed
Created January 12, 2016 15:32
Show Gist options
  • Save Torxed/3e1d12ba00dd9358c210 to your computer and use it in GitHub Desktop.
Save Torxed/3e1d12ba00dd9358c210 to your computer and use it in GitHub Desktop.
A example where `Keep-Alive` is used in the HTTP/1.X protocol and Python
from urllib3 import HTTPConnectionPool
pool = HTTPConnectionPool('www.google.se', maxsize=1)
ret = pool.request('GET', '/')
print(ret.status)
ret_two = pool.request('GET', '/search', fields={'q' : 'python'})
print(ret_two)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment