'Parse the request info
@param r: the web2py Request, falls back to current.request'

def _parse(self, r=None):

    request = (current.request if (r is None) else r)
    args = request.args
    get_vars = request.get_vars
    command = None
    if (len(args) > 0):
        command = args[0]
        if ('.' in command):
            command = command.split('.', 1)[0]
    if command:
        self.command = command
    bulk = get_vars.get('bulk')
    bulk = (True if (bulk and (bulk.lower() in ('1', 'true'))) else False)
    agent_id = request.get_vars.get('agent')
    if agent_id:
        if (type(agent_id) is list):
            agent_id = ','.join(agent_id)
        if (',' in agent_id):
            bulk = True
            agent_id = set([s.strip() for s in agent_id.split(',')])
            agent_id.discard('')
            agent_id = list(agent_id)
        elif bulk:
            agent_id = [agent_id]
        self.agent = agent_id
    self.bulk = bulk
    self.http = (current.request.env.request_method or 'GET')
    self.representation = (s3_get_extension(request) or DEFAULT_FORMAT)
