def parse_response(resp, content, strict=False, content_type=None):
if not content_type:<EOL><INDENT>content_type = resp.headers.get('<STR_LIT>', '<STR_LIT:application/json>')<EOL><DEDENT>ct, options = parse_options_header(content_type)<EOL>if ct in ('<STR_LIT:application/json>', '<STR_LIT>'):<EOL><INDENT>if not content:<EOL><INDENT>return {}<EOL><DEDENT>return json.loads(content)<EOL><DEDENT>if ct in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>return get_etree().fromstring(content)<EOL><DEDENT>if ct != '<STR_LIT>' and strict:<EOL><INDENT>return content<EOL><DEDENT>charset = options.get('<STR_LIT>', '<STR_LIT:utf-8>')<EOL>return url_decode(content, charset=charset).to_dict()<EOL>
Parse the response returned by :meth:`OAuthRemoteApp.http_request`.

    :param resp: response of http_request
    :param content: content of the response
    :param strict: strict mode for form urlencoded content
    :param content_type: assign a content type manually