def parse_body_arguments(content_type, body, arguments, files, headers=None):
 if (headers and ('Content-Encoding' in headers)):
  gen_log.warning('Unsupported Content-Encoding: %s', headers['Content-Encoding'])
  return
 if content_type.startswith('application/x-www-form-urlencoded'):
  try:
   uri_arguments = parse_qs_bytes(native_str(body), keep_blank_values=True)
  except Exception as e:
   gen_log.warning('Invalid x-www-form-urlencoded body: %s', e)
   uri_arguments = {}
  for (name, values) in uri_arguments.items():
   if values:
    arguments.setdefault(name, []).extend(values)
 elif content_type.startswith('multipart/form-data'):
  try:
   fields = content_type.split(';')
   for field in fields:
    (k, sep, v) = field.strip().partition('=')
    if ((k == 'boundary') and v):
     parse_multipart_form_data(utf8(v), body, arguments, files)
     break
   else:
    raise ValueError('multipart boundary not found')
  except Exception as e:
   gen_log.warning('Invalid multipart/form-data: %s', e)

def parse_body_arguments ( content_type , body , arguments , files , headers = None ) : if ( headers and ( 'Content-Encoding' in headers ) ) : gen_log . warning ( 'Unsupported Content-Encoding: %s' , headers [ 'Content-Encoding' ] ) return if content_type . startswith ( 'application/x-www-form-urlencoded' ) : try : uri_arguments = parse_qs_bytes ( native_str ( body ) , keep_blank_values = True ) except Exception as e : gen_log . warning ( 'Invalid x-www-form-urlencoded body: %s' , e ) uri_arguments = { } for ( name , values ) in uri_arguments . items ( ) : if values : arguments . setdefault ( name , [ ] ) . extend ( values ) elif content_type . startswith ( 'multipart/form-data' ) : try : fields = content_type . split ( ';' ) for field in fields : ( k , sep , v ) = field . strip ( ) . partition ( '=' ) if ( ( k == 'boundary' ) and v ) : parse_multipart_form_data ( utf8 ( v ) , body , arguments , files ) break else : raise ValueError ( 'multipart boundary not found' ) except Exception as e : gen_log . warning ( 'Invalid multipart/form-data: %s' , e )
parses a form request body .