How to fix 'HTTP-415' error, during POST request in REST web service using spring boot
I am a beginner in Spring Boot and learning my way through.
How to fix 'HTTP-415' error, during POST request in REST web service using Spring Boot as below? I have tried @RequestMapping annotation, @RequestParam. @RequestParam gives some other error 401. However, 415 is consistent with @RequestMapping and @PostMapping.
Issue with @PostMapping request.
{
"timestamp": "2018-12-31T18:29:36.727+0000",
"status": 415,
"error": "Unsupported Media Type",
"message": "Content type 'text/plain;charset=UTF-8' not supported",
"trace": "org.springframework.web.HttpMediaTypeNotSupportedException: Content type
'text/plain;charset=UTF-8' not supportedrntat
org.springframework.web.servlet.mvc.method.annotation.
AbstractMessageConverterMethodArgumentResolver.
readWithMessageConverters
(AbstractMessageConverterMethodArgumentResolver.java:224)rntat
org.springframework.web.servlet.mvc.method.annotation.
RequestResponseBodyMethodProcessor.
readWithMessageConverters(RequestResponseBodyMethodProcessor.java:157)
rntat org.springframework.web.servlet.mvc.method.
annotation.RequestResponseBodyMethodProcessor.
resolveArgument(RequestResponseBodyMethodProcessor.java:130)
rntat...................
While placing following request:

StudentController.java
@RestController
public class StudentController {
@Autowired
private StudentService studentService;
:
:
@PostMapping("/students/{studentId}/courses")
public ResponseEntity<Void> registerStudentForCourse(
@PathVariable String studentId,
@RequestBody Course newCourse) {
Course course = studentService.addCourse(studentId, newCourse);
if (course == null)
return ResponseEntity.noContent().build();
URI location = ServletUriComponentsBuilder.fromCurrentRequest().
path("/{id}").buildAndExpand(course.getId()).toUri();
return ResponseEntity.created(location).build();
}
StudentService.java
@Component
public class StudentService {
:
:
public Course addCourse(String studentId, Course course) {
Student student = retrieveStudent(studentId);
if (student == null) {
return null;
}
String randomId = new BigInteger(130, random).toString(32);
course.setId(randomId);
student.getCourses().put(course.getId(), course);
return course;
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot</groupId>
<artifactId>student-services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>student-services</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
java spring-boot spring-mvc http-status-code-415
add a comment |
I am a beginner in Spring Boot and learning my way through.
How to fix 'HTTP-415' error, during POST request in REST web service using Spring Boot as below? I have tried @RequestMapping annotation, @RequestParam. @RequestParam gives some other error 401. However, 415 is consistent with @RequestMapping and @PostMapping.
Issue with @PostMapping request.
{
"timestamp": "2018-12-31T18:29:36.727+0000",
"status": 415,
"error": "Unsupported Media Type",
"message": "Content type 'text/plain;charset=UTF-8' not supported",
"trace": "org.springframework.web.HttpMediaTypeNotSupportedException: Content type
'text/plain;charset=UTF-8' not supportedrntat
org.springframework.web.servlet.mvc.method.annotation.
AbstractMessageConverterMethodArgumentResolver.
readWithMessageConverters
(AbstractMessageConverterMethodArgumentResolver.java:224)rntat
org.springframework.web.servlet.mvc.method.annotation.
RequestResponseBodyMethodProcessor.
readWithMessageConverters(RequestResponseBodyMethodProcessor.java:157)
rntat org.springframework.web.servlet.mvc.method.
annotation.RequestResponseBodyMethodProcessor.
resolveArgument(RequestResponseBodyMethodProcessor.java:130)
rntat...................
While placing following request:

StudentController.java
@RestController
public class StudentController {
@Autowired
private StudentService studentService;
:
:
@PostMapping("/students/{studentId}/courses")
public ResponseEntity<Void> registerStudentForCourse(
@PathVariable String studentId,
@RequestBody Course newCourse) {
Course course = studentService.addCourse(studentId, newCourse);
if (course == null)
return ResponseEntity.noContent().build();
URI location = ServletUriComponentsBuilder.fromCurrentRequest().
path("/{id}").buildAndExpand(course.getId()).toUri();
return ResponseEntity.created(location).build();
}
StudentService.java
@Component
public class StudentService {
:
:
public Course addCourse(String studentId, Course course) {
Student student = retrieveStudent(studentId);
if (student == null) {
return null;
}
String randomId = new BigInteger(130, random).toString(32);
course.setId(randomId);
student.getCourses().put(course.getId(), course);
return course;
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot</groupId>
<artifactId>student-services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>student-services</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
java spring-boot spring-mvc http-status-code-415
Try to set the "Content-Type" header to application/json ?
– Ken Chan
Jan 3 at 16:54
You use Xml type content , change it by json
– TinyOS
Jan 3 at 16:57
As Ken Chan said, try to put content type header in controller and client side. HTTP 415 happens when from front end data sent with ambiguous or wrong content type to backend.
– JIT Develop
Jan 3 at 17:02
Thanks all, issue is fixed by adding content header as you all suggested
– Soumali Chatterjee
Jan 3 at 17:32
add a comment |
I am a beginner in Spring Boot and learning my way through.
How to fix 'HTTP-415' error, during POST request in REST web service using Spring Boot as below? I have tried @RequestMapping annotation, @RequestParam. @RequestParam gives some other error 401. However, 415 is consistent with @RequestMapping and @PostMapping.
Issue with @PostMapping request.
{
"timestamp": "2018-12-31T18:29:36.727+0000",
"status": 415,
"error": "Unsupported Media Type",
"message": "Content type 'text/plain;charset=UTF-8' not supported",
"trace": "org.springframework.web.HttpMediaTypeNotSupportedException: Content type
'text/plain;charset=UTF-8' not supportedrntat
org.springframework.web.servlet.mvc.method.annotation.
AbstractMessageConverterMethodArgumentResolver.
readWithMessageConverters
(AbstractMessageConverterMethodArgumentResolver.java:224)rntat
org.springframework.web.servlet.mvc.method.annotation.
RequestResponseBodyMethodProcessor.
readWithMessageConverters(RequestResponseBodyMethodProcessor.java:157)
rntat org.springframework.web.servlet.mvc.method.
annotation.RequestResponseBodyMethodProcessor.
resolveArgument(RequestResponseBodyMethodProcessor.java:130)
rntat...................
While placing following request:

StudentController.java
@RestController
public class StudentController {
@Autowired
private StudentService studentService;
:
:
@PostMapping("/students/{studentId}/courses")
public ResponseEntity<Void> registerStudentForCourse(
@PathVariable String studentId,
@RequestBody Course newCourse) {
Course course = studentService.addCourse(studentId, newCourse);
if (course == null)
return ResponseEntity.noContent().build();
URI location = ServletUriComponentsBuilder.fromCurrentRequest().
path("/{id}").buildAndExpand(course.getId()).toUri();
return ResponseEntity.created(location).build();
}
StudentService.java
@Component
public class StudentService {
:
:
public Course addCourse(String studentId, Course course) {
Student student = retrieveStudent(studentId);
if (student == null) {
return null;
}
String randomId = new BigInteger(130, random).toString(32);
course.setId(randomId);
student.getCourses().put(course.getId(), course);
return course;
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot</groupId>
<artifactId>student-services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>student-services</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
java spring-boot spring-mvc http-status-code-415
I am a beginner in Spring Boot and learning my way through.
How to fix 'HTTP-415' error, during POST request in REST web service using Spring Boot as below? I have tried @RequestMapping annotation, @RequestParam. @RequestParam gives some other error 401. However, 415 is consistent with @RequestMapping and @PostMapping.
Issue with @PostMapping request.
{
"timestamp": "2018-12-31T18:29:36.727+0000",
"status": 415,
"error": "Unsupported Media Type",
"message": "Content type 'text/plain;charset=UTF-8' not supported",
"trace": "org.springframework.web.HttpMediaTypeNotSupportedException: Content type
'text/plain;charset=UTF-8' not supportedrntat
org.springframework.web.servlet.mvc.method.annotation.
AbstractMessageConverterMethodArgumentResolver.
readWithMessageConverters
(AbstractMessageConverterMethodArgumentResolver.java:224)rntat
org.springframework.web.servlet.mvc.method.annotation.
RequestResponseBodyMethodProcessor.
readWithMessageConverters(RequestResponseBodyMethodProcessor.java:157)
rntat org.springframework.web.servlet.mvc.method.
annotation.RequestResponseBodyMethodProcessor.
resolveArgument(RequestResponseBodyMethodProcessor.java:130)
rntat...................
While placing following request:

StudentController.java
@RestController
public class StudentController {
@Autowired
private StudentService studentService;
:
:
@PostMapping("/students/{studentId}/courses")
public ResponseEntity<Void> registerStudentForCourse(
@PathVariable String studentId,
@RequestBody Course newCourse) {
Course course = studentService.addCourse(studentId, newCourse);
if (course == null)
return ResponseEntity.noContent().build();
URI location = ServletUriComponentsBuilder.fromCurrentRequest().
path("/{id}").buildAndExpand(course.getId()).toUri();
return ResponseEntity.created(location).build();
}
StudentService.java
@Component
public class StudentService {
:
:
public Course addCourse(String studentId, Course course) {
Student student = retrieveStudent(studentId);
if (student == null) {
return null;
}
String randomId = new BigInteger(130, random).toString(32);
course.setId(randomId);
student.getCourses().put(course.getId(), course);
return course;
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot</groupId>
<artifactId>student-services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>student-services</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
java spring-boot spring-mvc http-status-code-415
java spring-boot spring-mvc http-status-code-415
edited Jan 4 at 6:16
Paul Samsotha
154k21299493
154k21299493
asked Jan 3 at 16:51
Soumali ChatterjeeSoumali Chatterjee
167
167
Try to set the "Content-Type" header to application/json ?
– Ken Chan
Jan 3 at 16:54
You use Xml type content , change it by json
– TinyOS
Jan 3 at 16:57
As Ken Chan said, try to put content type header in controller and client side. HTTP 415 happens when from front end data sent with ambiguous or wrong content type to backend.
– JIT Develop
Jan 3 at 17:02
Thanks all, issue is fixed by adding content header as you all suggested
– Soumali Chatterjee
Jan 3 at 17:32
add a comment |
Try to set the "Content-Type" header to application/json ?
– Ken Chan
Jan 3 at 16:54
You use Xml type content , change it by json
– TinyOS
Jan 3 at 16:57
As Ken Chan said, try to put content type header in controller and client side. HTTP 415 happens when from front end data sent with ambiguous or wrong content type to backend.
– JIT Develop
Jan 3 at 17:02
Thanks all, issue is fixed by adding content header as you all suggested
– Soumali Chatterjee
Jan 3 at 17:32
Try to set the "Content-Type" header to application/json ?
– Ken Chan
Jan 3 at 16:54
Try to set the "Content-Type" header to application/json ?
– Ken Chan
Jan 3 at 16:54
You use Xml type content , change it by json
– TinyOS
Jan 3 at 16:57
You use Xml type content , change it by json
– TinyOS
Jan 3 at 16:57
As Ken Chan said, try to put content type header in controller and client side. HTTP 415 happens when from front end data sent with ambiguous or wrong content type to backend.
– JIT Develop
Jan 3 at 17:02
As Ken Chan said, try to put content type header in controller and client side. HTTP 415 happens when from front end data sent with ambiguous or wrong content type to backend.
– JIT Develop
Jan 3 at 17:02
Thanks all, issue is fixed by adding content header as you all suggested
– Soumali Chatterjee
Jan 3 at 17:32
Thanks all, issue is fixed by adding content header as you all suggested
– Soumali Chatterjee
Jan 3 at 17:32
add a comment |
2 Answers
2
active
oldest
votes
it's clearly in postman you are sending information as form-urlencoded but in your controller, you are expecting a request body (e. json), so you need either change @RequestBody to @ModleAtrributes or send you information with header Content-type: application/json
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
add a comment |
Issue is Fixed by adding content header as application/json

add a comment |
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54026519%2fhow-to-fix-http-415-error-during-post-request-in-rest-web-service-using-sprin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
it's clearly in postman you are sending information as form-urlencoded but in your controller, you are expecting a request body (e. json), so you need either change @RequestBody to @ModleAtrributes or send you information with header Content-type: application/json
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
add a comment |
it's clearly in postman you are sending information as form-urlencoded but in your controller, you are expecting a request body (e. json), so you need either change @RequestBody to @ModleAtrributes or send you information with header Content-type: application/json
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
add a comment |
it's clearly in postman you are sending information as form-urlencoded but in your controller, you are expecting a request body (e. json), so you need either change @RequestBody to @ModleAtrributes or send you information with header Content-type: application/json
it's clearly in postman you are sending information as form-urlencoded but in your controller, you are expecting a request body (e. json), so you need either change @RequestBody to @ModleAtrributes or send you information with header Content-type: application/json
answered Jan 3 at 17:08
stackerstacker
1,851229
1,851229
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
add a comment |
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
Thanks @slimane Issue fixed.
– Soumali Chatterjee
Jan 3 at 17:27
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
@SoumaliChatterjee you accept the answer if it helped
– stacker
Jan 3 at 18:29
add a comment |
Issue is Fixed by adding content header as application/json

add a comment |
Issue is Fixed by adding content header as application/json

add a comment |
Issue is Fixed by adding content header as application/json

Issue is Fixed by adding content header as application/json

answered Jan 3 at 17:30
Soumali ChatterjeeSoumali Chatterjee
167
167
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54026519%2fhow-to-fix-http-415-error-during-post-request-in-rest-web-service-using-sprin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown

Try to set the "Content-Type" header to application/json ?
– Ken Chan
Jan 3 at 16:54
You use Xml type content , change it by json
– TinyOS
Jan 3 at 16:57
As Ken Chan said, try to put content type header in controller and client side. HTTP 415 happens when from front end data sent with ambiguous or wrong content type to backend.
– JIT Develop
Jan 3 at 17:02
Thanks all, issue is fixed by adding content header as you all suggested
– Soumali Chatterjee
Jan 3 at 17:32