async convert()

in src/convert.ts [270:287]


  async convert(
    requests: ParsedRequest[],
    options: ConvertOptions,
  ): Promise<string> {
    const response = await fetch(`${this.baseUrl}/convert`, {
      method: "POST",
      body: JSON.stringify({ requests: getSlimRequests(requests), options }),
      headers: { "Content-Type": "application/json" },
    });
    if (response.ok) {
      const json = await response.json();
      if (json.error) {
        throw new Error(json.error);
      }
      return json.return;
    }
    throw new Error("Could not make web request");
  }