koo*_*ker 2 curl multipartform-data telegram-bot
我尝试过以下方法:
curl -F name=document -F upload=@<path_to_the_file> \
-H "Content-Type:multipart/form-data" \
"https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>"
Run Code Online (Sandbox Code Playgroud)
它回来了 {"ok":false,"error_code":400,"description":"[Error]: Bad Request: there is no document in request"}
我做错了什么?
这是关于sendDocument方法的一些文档.
Nic*_*Lee 10
希望这可以帮助.请注意,之前有"bot" <token>.
curl -F document=@"path/to/some.file" https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>
Run Code Online (Sandbox Code Playgroud)