Skip to content

Instantly share code, notes, and snippets.

@karanlyons
Created June 2, 2018 21:54
Show Gist options
  • Save karanlyons/a9610e17b021d310b83ccd644382b8b1 to your computer and use it in GitHub Desktop.
Save karanlyons/a9610e17b021d310b83ccd644382b8b1 to your computer and use it in GitHub Desktop.
import os
from http.client import HTTPSConnection
from time import sleep
def request():
connection = HTTPSConnection('httpbin.org')
connection.request('GET', '/headers')
return connection.getresponse().read()
if __name__ == '__main__':
print(request())
if os.fork() == 0:
print(request())
else:
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment