'build rest url path'

def _path(self, path, base_path=None):

    if (path.startswith('http://') or path.startswith('https://')):
        return path
    if (base_path is None):
        base_path = self.base_path
    if ((not path.startswith(base_path)) and (not (self.local and ('/api' + path).startswith(base_path)))):
        path = ('%s%s' % (base_path, path))
    if (self.local and path.startswith('/api')):
        path = path[4:]
    return (self.url + path)
