Failed to load resource: the server responded with a status of 550

Failed to load resource: the server responded with a status of 550 (Error happened: No JSON object could be decoded)

    const xhr4 = new XMLHttpRequest()
    xhr4.open('post', `/api/${sessionStorage.getItem('session')}/data/`, true);
    var fd4 = new FormData()
    fd4.append('cmdid', 'get_changes')
    fd4.append('block_secs', 10)
    xhr4.send(fd4);  //发送请求

在send处报错
响应为{},响应应该是对的,就是报错了,而且响应是空,也不知道是请求失败响应的空还是请求成功响应的空。

试过把fd4换成json,也是一样的错误

希望解决报错,或者明白报错的原理:No JSON object could be decoded是指fd4还是响应的内容或者是其他的对象,如果是响应的内容那是不是请求成功了,如果请求成功了能不能忽略报错

请指定content-type为json,数据传递为json的str

你看浏览器 network里 response返回数据了吗?大概率没返回 5开头的错 都是 服务端的问题