If the Backend provides an API with Content-Type "application/stream+json" or "text/event-stream" swagger-ui should use an EventSource instead of sending ajax http-requests.
code:
var evtSource = new EventSource('http:server.domain.com/context_path)');
evtSource.onerror = function(e) {
console.log(e.data);
}
evtSource.onmessage = function(event) {
console.log(event.data);
}
instead of logging the data it should be displayed in the response field.
If the Backend provides an API with Content-Type "application/stream+json" or "text/event-stream" swagger-ui should use an EventSource instead of sending ajax http-requests.
code: var evtSource = new EventSource('http:server.domain.com/context_path)'); evtSource.onerror = function(e) { console.log(e.data); } evtSource.onmessage = function(event) { console.log(event.data); }
instead of logging the data it should be displayed in the response field.
For IE-Support maybe it is necessary to include an polyfill. e.g.: eventsource.js from https://github.com/Yaffle/EventSource/