Skip to content

Missing argument in createTask method #26

@AnthonyLzq

Description

@AnthonyLzq

I was checking the AntiCaptcha class, the method createTask has three params in the method signature, according to this:

/**
   * Dispatch a task creation to the service. This will return a taskId.
   *
   * @param {string} task - Task to perform
   * @param {string} websiteKey - The value of the "data-site-key" attribute. <- this param is missing
   * @param {string} languagePool - The language pool. Default to English if not provided.
   *
   * @memberof AntiCaptcha
   */
  public async createTask<T>(
    task: T,
    languagePool: LanguagePoolTypes = LanguagePoolTypes.ENGLISH
  ) {
    const response = (await this.api.post("createTask", {
      languagePool,
      task
    })) as ApiResponse<ICreateTaskResponse>;

    if (response.ok && response.data.errorId === 0) {
      return response.data.taskId;
    }
    throw new AntiCaptchaError(
      response.data.errorCode,
      response.data.errorDescription
    );
  }

Is the websiteKey not longer required?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions