def _connect(self, url, params, ok_codes, rtype, description,<EOL>redirect=False, consumer=None):
<EOL>if self.cookie:<EOL><INDENT>self.setHeader('<STR_LIT>', self.cookie.render_to_string())<EOL><DEDENT>response = super(TestCase, self)._connect(<EOL>url, params, ok_codes, rtype, description,<EOL>redirect=redirect, consumer=consumer)<EOL>for key, value in response.headers.items():<EOL><INDENT>if key.lower() == '<STR_LIT>':<EOL><INDENT>self.cookie.from_cookie_string(value)<EOL><DEDENT><DEDENT>content_type_header = response.headers.get('<STR_LIT>')<EOL>if content_type_header:<EOL><INDENT>if '<STR_LIT:;>' in content_type_header:<EOL><INDENT>content_type, charset_pair = content_type_header.split('<STR_LIT:;>', <NUM_LIT:1>)<EOL>if '<STR_LIT:=>' in charset_pair:<EOL><INDENT>_key, charset = charset_pair.split('<STR_LIT:=>', <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>charset = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>content_type = content_type_header<EOL>charset = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>content_type = charset = None<EOL><DEDENT>response.content_type_header = content_type_header<EOL>if content_type:<EOL><INDENT>response.content_type = content_type.strip()<EOL><DEDENT>else:<EOL><INDENT>response.content_type = None<EOL><DEDENT>response.charset = charset<EOL>if response.content_type == '<STR_LIT:application/json>':<EOL><INDENT>response.data = json.loads(response.body)<EOL><DEDENT>else:<EOL><INDENT>response.data = None<EOL><DEDENT>return response<EOL>
Override FunkLoadTestCase._connect