public function getAllDocs($incDocs = false, $limit = null, $startKey = null, $endKey = null, $keys = null, $descending = false, $skip = 0) {
    if(!$this->db) {
      throw new SagException('No database specified.');
    }

    $qry = array();

    if($incDocs !== false) {
      if(!is_bool($incDocs)) {
        throw new SagException('getAllDocs() expected a boolean for include_docs.');
      }

      $qry[] = "include_docs=true";
    }

    if(isset($startKey)) {
      if(!is_string($startKey)) {
        throw new SagException('getAllDocs() expected a string for startkey.');
      }

      $qry[] = 'startkey='.urlencode($startKey);
    }

    if(isset($endKey)) {
      if(!is_string($endKey)) {
        throw new SagException('getAllDocs() expected a string for endkey.');
      }

      $qry[] = 'endkey='.urlencode($endKey);
    }

    if(isset($limit)) {
      if(!is_int($limit) || $limit < 0) {
        throw new SagException('getAllDocs() expected a positive integeter for limit.');
      }

      $qry[] = 'limit='.urlencode($limit);
    }

    if($descending !== false) {
      if(!is_bool($descending)) {
        throw new SagException('getAllDocs() expected a boolean for descending.');
      }

      $qry[] = "descending=true";
    }

    if(isset($skip)) {
      if(!is_int($skip) || $skip < 0) {
        throw new SagException('getAllDocs() expected a non-negative integer for skip');
      }

      $qry[] = 'skip=' . urlencode($skip);
    }

    $qry = '?'.implode('&', $qry);

    if(isset($keys))
    {
      if(!is_array($keys)) {
        throw new SagException('getAllDocs() expected an array for the keys.');
      }

      $data = new stdClass();
      $data->keys = $keys;

      return $this->procPacket('POST', "/{$this->db}/_all_docs$qry", json_encode($data));
    }

    return $this->procPacket('GET', "/{$this->db}/_all_docs$qry");
  }