Код: Выделить всё
{
"timestamp": "2023-03-11T09:58:15.535+00:00",
"status": 415,
"error": "Unsupported Media Type",
"path": "/api/telegram/sendCustomMessage"
}
< /code>
Мой контроллер: < /p>
@RestController
@CrossOrigin("*")
@RequestMapping("/api/telegram")
public class TelegramBotController {
private final TelegramService telegramService;
@Autowired
public TelegramBotController(TelegramService telegramService) {
this.telegramService = telegramService;
}
@PostMapping("/sendCustomMessage")
public ResponseEntity sendCustomMessage(
@RequestBody List accounts,
String message
) {
// telegramService.sendGroupMessageByAccountIdList(accountIds, message);
return ResponseEntity.ok().build();
}
}
< /code>
мой корпус запроса < /p>
{
"accounts": [1, 2, 3],
"message": "Custom Message"
}
Подробнее здесь: https://stackoverflow.com/questions/757 ... to-postman