Error 400 bad request when i getInputStream in HandlerInterceptorAdapter

I want to get the JSON of the entry body in the Request and for this I used HttpServletRequestWrapper guiding me by the comments here.

The problem when I use this my tomcat server returns 400 Bad Request error, but nothing appears in the log and I do not know why it does not work.

This my code.

My RequestWrapper alias RequestWrapperAccess

public class RequestWrapperAccess extends HttpServletRequestWrapper {

private final String body;

public RequestWrapperAccess(HttpServletRequest request) throws IOException {


StringBuilder stringBuilder = new StringBuilder();

BufferedReader bufferedReader = null;

try {

InputStream inputStream = request.getInputStream();

if (inputStream != null) {

bufferedReader = new BufferedReader(new...

Read More »

By: StackOverFlow - 5 days ago

Related Posts