def __body_format(self, body):
ctype, pdict = parse_header(self.content_type)<EOL>if ctype == '<STR_LIT:application/json>':<EOL><INDENT>self.form = json.loads(body.decode())<EOL><DEDENT>elif ctype == '<STR_LIT>':<EOL><INDENT>for key, value in parse_qs(body).items():<EOL><INDENT>self.form[key.decode()] = [one_value.decode() for one_value in value]<EOL><DEDENT><DEDENT>elif ctype == "<STR_LIT>":<EOL><INDENT>safe_env = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': self.method.upper(),<EOL>'<STR_LIT>': self.content_type,<EOL>'<STR_LIT>': self.headers.get('<STR_LIT>', '<STR_LIT>')<EOL>}<EOL>fields = FieldStorage(io.BytesIO(body), environ=safe_env, keep_blank_values=True)<EOL>fields = fields.list or []<EOL>for field in fields:<EOL><INDENT>if field.filename:<EOL><INDENT>self.form[field.name] = File(field.filename, field.file)<EOL><DEDENT>else:<EOL><INDENT>self.form[field.name] = field.value<EOL><DEDENT><DEDENT><DEDENT>
format body into different type
:param body:
:return: