标签: javascript eventsource
如何捕获失败的EventSource连接的http状态代码?
EventSource
function onError(event) { console.log('request status code?'); } const source = new EventSource('url', { withCredentials: true }); source.addEventListener('error', onError);