I have this end point which will take in a petId and a Multipart file but no matter how I tried in postman, I just get
this error :
'timestamp" : "asdfadsfa",
"status" : 415,
"error" : "Unsupported Media Type",
"message": "",
"path": "/pet/2/uploadImage"
Here's my code:
It is tweaked from
//https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/
as suggested from my 'mentor'
I also tried to use ResponseEntity<UploadFileResponse> like what the sample code did, without success.
Then, I tried to convert it into Base64 and changed to produces produces = MediaType.JPGE , also not successful but obviously for this uescase they are looking for a file as Json.
Another thing I noticed is that, there is no print out of
so I wonder if did get into the method at all.
The console shows the following error :
I hope some one can point out what is wrong.
BTW, the is a pet before petId/uploadImage route.