def default_handler(url, method, timeout, headers, data):
def handle():<EOL><INDENT>request = Request(url, data=data)<EOL>request.get_method = lambda: method<EOL>for k, v in headers:<EOL><INDENT>request.add_header(k, v)<EOL><DEDENT>resp = build_opener(HTTPHandler).open(request, timeout=timeout)<EOL>if resp.code >= <NUM_LIT>:<EOL><INDENT>raise IOError("<STR_LIT>".format(<EOL>resp.code, resp.msg))<EOL><DEDENT><DEDENT>return handle<EOL>
Default handler that implements HTTP/HTTPS connections.

    Used by the push_to_gateway functions. Can be re-used by other handlers.