Код: Выделить всё
curl -v -F "chat_id=-46546544565" -F document=@/path/to/my/doc https://api.telegram.org/bot523452345rewrweEEE/sendDocument
Моя попытка была
Код: Выделить всё
@POST("sendDocument")
Call sendDocument(@Body ByteArrayResource file, @Query("chat_id") String chatId);
Код: Выделить всё
@Bean
TelegramService getRetrofitTelegram() {
String baseTelegramUrl = "https://api.telegram.org/bot" + applicationConfig.getBotApiKey()+ "/";
log.info("[getRetrofitTelegram] baseTelegramUrl = {}", baseTelegramUrl);
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(baseTelegramUrl)
.addConverterFactory(GsonConverterFactory.create(new Gson()))
.build();
return retrofit.create(TelegramService.class);
}
Код: Выделить всё
Bad Request: there is no document in the request
Подробнее здесь: https://stackoverflow.com/questions/787 ... t2-in-java
Мобильная версия