def _get_request_value(request, value_name, default=''):
 if ((request is not None) and hasattr(request, 'GET') and (value_name in request.GET)):
  return request.GET[value_name]
 elif ((request is not None) and hasattr(request, 'POST') and (value_name in request.POST)):
  return request.POST[value_name]
 else:
  return default

def _get_request_value ( request , value_name , default = '' ) : if ( ( request is not None ) and hasattr ( request , 'GET' ) and ( value_name in request . GET ) ) : return request . GET [ value_name ] elif ( ( request is not None ) and hasattr ( request , 'POST' ) and ( value_name in request . POST ) ) : return request . POST [ value_name ] else : return default
helper method to get header values from a requests get or post dicts .