def _get_data(self, url, accept=None):
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>": 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>if accept:<EOL><INDENT>head['<STR_LIT>'] = accept<EOL><DEDENT>conn.request("<STR_LIT:GET>", url, "<STR_LIT>", head)<EOL>resp = conn.getresponse()<EOL>self._handle_response_errors('<STR_LIT:GET>', url, resp)<EOL>content_type = resp.getheader('<STR_LIT>')<EOL>if '<STR_LIT:application/json>' in content_type:<EOL><INDENT>return json.loads(resp.read())<EOL><DEDENT>return resp.read()<EOL>
GETs the resource at url and returns the raw response
If the accept parameter is not None, the request passes is as the Accept header