public function replicate($src, $target, $continuous = false, $createTarget = null, $filter = null, $filterQueryParams = null) {
    if(empty($src) || !is_string($src)) {
      throw new SagException('replicate() is missing a source to replicate from.');
    }

    if(empty($target) || !is_string($target)) {
      throw new SagException('replicate() is missing a target to replicate to.');
    }

    if(!is_bool($continuous)) {
      throw new SagException('replicate() expected a boolean for its third argument.');
    }

    if(isset($createTarget) && !is_bool($createTarget)) {
      throw new SagException('createTarget needs to be a boolean.');
    }

    if(isset($filter)) {
      if(!is_string($filter)) {
        throw new SagException('filter must be the name of a design doc\'s filter function: ddoc/filter');
      }

      if(isset($filterQueryParams) && !is_object($filterQueryParams) && !is_array($filterQueryParams)) {
        throw new SagException('filterQueryParams needs to be an object or an array');
      }
    }

    $data = new stdClass();
    $data->source = $src;
    $data->target = $target;

    /*
     * These guys are optional, so only include them if non-default to save on
     * packet size.
     */
    if($continuous) {
      $data->continuous = true;
    }

    if($createTarget) {
      $data->create_target = true;
    }

    if($filter) {
      $data->filter = $filter;

      if($filterQueryParams) {
        $data->query_params = $filterQueryParams;
      }
    }

    return $this->procPacket('POST', '/_replicate', json_encode($data));
  }