Я хочу отправить файл через http Telegram API и попробовать этот код:
def send_media(self, chat_id, doc):
method = 'sendDocument'
params = {'chat_id': chat_id, 'document': doc}
resp = requests.post(self.api_url + method, params)
return resp
document = open('table.csv', 'rb')
doc = InputFile(document)
bot.send_media(last_chat_id, doc).json()
document.close()
И по запросу появляется такая ошибка:
{'ok': False, 'error_code': 400, 'description': 'Bad Request: wrong URL host'}
Что мне нужно сделать, чтобы отправить файл