def _construct_request(self):
if self.parsed_endpoint.scheme == '<STR_LIT>':<EOL><INDENT>conn = http.client.HTTPSConnection(self.parsed_endpoint.netloc)<EOL><DEDENT>else:<EOL><INDENT>conn = http.client.HTTPConnection(self.parsed_endpoint.netloc)<EOL><DEDENT>head = {<EOL>"<STR_LIT>": "<STR_LIT:application/json>",<EOL>"<STR_LIT>": USER_AGENT,<EOL>API_TOKEN_HEADER_NAME: self.api_token,<EOL>}<EOL>if self.api_version in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>head[API_VERSION_HEADER_NAME] = self.api_version<EOL><DEDENT>return conn, head<EOL>
Utility for constructing the request header and connection