ResponseEntity Not Working as Expected in Spring Boot

Viewed 15

This is MyCode:

rsConfig.setResponse(new ResponseEntity<List<Map<String, Object>>>(CommonConstant.methodList,
                    HttpStatus.METHOD_NOT_ALLOWED));

rsConfig is an Object and setResponse is the setter to get the response from a array

Response I Get:

   {
    "headers": {},
    "body": [
        {
            "Status": "Method Not Supported"
        }
    ],
    "statusCodeValue": 405,
    "statusCode": "METHOD_NOT_ALLOWED"
}

Response I Want:

[
    {
        "Status": "Method Not Supported"
    }
]
0 Answers
Related