通过curl将文件发布到telegram bot api

通过curl将文件发布到telegram bot api,curl,multipartform-data,telegram-bot,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>" curl-F name=document-F upload=@\ -H“内容类型:多部分/表

我尝试了以下方法:

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>"
curl-F name=document-F upload=@\
-H“内容类型:多部分/表单数据”\
"https://api.telegram.org/bot/sendDocument?chat_id="
它返回
{“ok”:false,“error_code”:400,“description”:“[error]:错误请求:请求中没有文档”}

我做错了什么


是一些关于
sendDocument
方法的文档。

希望对您有所帮助。请注意,
前面有“bot”

curl-F document=@“path/to/some.file”https://api.telegram.org/bot/sendDocument?chat_id=

哦,谢谢,但当我使用真实凭据时,我确实键入了正确的url。我编辑了这个问题。我的错误是我键入了
upload=@
,而不是
document=@
。再次感谢。很高兴能帮忙。祝你好运
curl -F document=@"path/to/some.file" https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>