[Vuejs]-Can't send json response on POST request in Spring MVC controller

0๐Ÿ‘

โœ…

Itโ€™s turns out that I was sending POST request with json body to controller mapped to url with suffix โ€˜htmโ€™. This request cause conflict with mime-mapping โ€˜text/htmlโ€™ and as result server immediately response with code 406.

0๐Ÿ‘

I get the response properly when I do it from postman. I believe you have getters and setters.

use the header Accept: application/json

Mark the class as implements serializable.

Leave a comment