Iam trying to create an API that accept both files like CSV and json body request. I tried using ResponseEntity
object in spring boot.
The endpoint looks as below.
@PostMapping(value="/csv",consumes=MediaType.ALL_VALUE)
public void createConsumer(RequestEntity<?> data){
}
The content headers is set via postman.
The Content-Type
is text/csv
and Accept
is */*
.
The error thrown is
2021-03-12 19:28:10.344 WARN 5780 --- [nio-8089-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/csv' not supported]
How can I solve this?