Why fetch sometimes returns a malformed response?

A common example of fetch
fetch("https://api.example.com/items", {"method":"post","body": JSON.stringify(data))
 .then(res => res.json())
.then(
 (result) => {
},
 (error) => {
}
 )

On the LAN returns a normal response of type result = "{"a":"b"}" and on server, add it to the header
and have something like result = "{"a":"b"}{"header":{}}"
Why is this happening? the problem precisely not in the fetch I have tried using the library axios
the same. So something with the response from the server but the only difference is the http/https protocols
April 19th 20 at 12:39
0 answer

Find more questions by tags React