我有一个像这样的休息控制器方法 -
@RequestMapping(method = RequestMethod.POST, value = "/avdata",
consumes = {"application/json", "avro/binary", "avro/json"})
ResponseEntity<?> handleAvroData(@RequestHeader Map<String, String> httpHeaders,
@RequestBody Object input) {
此方法不必处理任何avro数据。在进行一些记录后,它必须将其推送到Kafka主题。
当我做卷曲请求时
curl --data '{"name":"test"}' -X POST -H 'Content-Type:avro/json' http://localhost:8080/avdata
它给了我以下错误
{"timestamp":1509654385753,
"status":415,
"error":"Unsupported Media Type",
"message":"Content type 'avro/json;charset=UTF-8' not supported",
"path":"/avdata"
}
有没有办法将avro数据发布到弹簧引导静止控制器?