Skip to content
Advertisement

400 Bad Request when using Spring Boot

I am sending a Http POST request to my RESTful API build with Spring Boot and get the “400 Bad Request” response.

My POST request is made with Postman, send to

JavaScript

with the body

JavaScript

I want to pass the filename variable to my Java Method. My RESTful api is build in Java with Spring Boot

JavaScript

I tried with and with out produces in the @RequestMapping annotation. I have no idea where the error comes from, maybe you can help me.

Regards!

Advertisement

Answer

Use @RequestBody to accept data in request body. As shown in below example:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement