![解释 texlive API 请求时出现的问题](https://linux22.com/image/433398/%E8%A7%A3%E9%87%8A%20texlive%20API%20%E8%AF%B7%E6%B1%82%E6%97%B6%E5%87%BA%E7%8E%B0%E7%9A%84%E9%97%AE%E9%A2%98.png)
我正在寻找一种向 TeXLive.net 服务器发送 HTTP POST 请求的方法,但失败了。有人能解释一下应该如何发送这样的请求吗?我收到此错误:
Bad form type
Unexpected param: pre0 Bad Form: no main document
pre0 位于提交按钮上
onclick="latexcgi("pre0")"
完整代码如下:
<form style="display" id="pre0" name="pre0" enctype="multipart/form-data" action="https://texlive.net/cgi-bin/latexcgi" method="post" target="pre0">
<textarea rows="8" cols="60" name="pre0">
\\documentclass{article}
\\usepackage{iftex}
\\newcommand\test[1]{\\par\\expandafter#1\\string#1: true\\fi}
\\begin{document}
\\ttfamily
\\test\\ifpdftex
\\test\\ifluatex
\\test\\ifxetex
\\test\\ifptex
\\test\\ifuptex
\\end{document}
</textarea>
<button type="submit" onclick="latexcgi("pre0")" value="Submit">
</form>
我希望生成的 pdf 文件是
\ifpdftex: true