def get_dict(*keys, **extras):
 _keys = ('url', 'args', 'form', 'data', 'origin', 'headers', 'files', 'json')
 assert all(map(_keys.__contains__, keys))
 data = request.data
 form = semiflatten(request.form)
 try:
  _json = json.loads(data.decode('utf-8'))
 except (ValueError, TypeError):
  _json = None
 d = dict(url=get_url(request), args=semiflatten(request.args), form=form, data=json_safe(data), origin=request.headers.get('X-Forwarded-For', request.remote_addr), headers=get_headers(), files=get_files(), json=_json)
 out_d = dict()
 for key in keys:
  out_d[key] = d.get(key)
 out_d.update(extras)
 return out_d

def get_dict ( * keys , ** extras ) : _keys = ( 'url' , 'args' , 'form' , 'data' , 'origin' , 'headers' , 'files' , 'json' ) assert all ( map ( _keys . __contains__ , keys ) ) data = request . data form = semiflatten ( request . form ) try : _json = json . loads ( data . decode ( 'utf-8' ) ) except ( ValueError , TypeError ) : _json = None d = dict ( url = get_url ( request ) , args = semiflatten ( request . args ) , form = form , data = json_safe ( data ) , origin = request . headers . get ( 'X-Forwarded-For' , request . remote_addr ) , headers = get_headers ( ) , files = get_files ( ) , json = _json ) out_d = dict ( ) for key in keys : out_d [ key ] = d . get ( key ) out_d . update ( extras ) return out_d
returns request dict of given keys .