The problem is that none of the WriterRepresentation implementations that I have seen (JsonRepresentation, JacksonRepresentation, XStreamRepresentation) sets the size of the presentation when transmitting the object. Therefore, if you create a new version of JacksonRepresentation (map), the size is not calculated.
You must manually calculate the length of the contents of the map and call Representation.setSize (). Or, like me, use
new JsonRepresentation ("json string ...");
This constructor can calculate the size, of course, the length of the string, so the correct content length header is set, and everything works smoothly.
source share