We have a Rest Service that returns a text/event-stream
from a POST endpoint, which contains a series of JSON Objects.
(It is a Spring Boot / Kotlin RestController that returns a kotlinx.coroutines.flow.Flow<SomeJSONObject>
)
Now we want to consume this event-stream in a angular WebApplication, processing each object as it arrives. Unfortunately we don't know how this works.
We tried the obvious things, like:
this.http.post(url, request)
or
this.http.post(url, request).toPromise().then(value => ...
and
this.http.post(url, request).subscribe(value => ...
It seems like the browser does not even make a request and does not receive any data. The backend service works fine, we can see this by calling the endpoint with e.g. postman.
It would be enaugh to have any hint how this works in JavaScript, then it will also work in angular.