'Using text/event-stream in Intellij HTTP Client

I have Spring based Java application with a REST controller which returns Project-Reactor's Flux type. The MediaType this GET endpoint returns is TEXT_EVENT_STREAM_VALUE.

To be clearer on the matter, the endpoint looks a little as follows, omitting the actual operation to return as it's not important:

@GetMapping(value = "/sample", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Sample> getSampleFlux() {
    return /* A Flux containing Sample */
}

This bit of code works, as when I call it from my code or through for example Chrome using the endpoint, the results are streamed through as desired.

However, I wanted to test this behavior with Intellij's HTTP Client. To this end, I created the following operation in a *.http file in my project:

GET localhost:8080/sample
Accept: text/event-stream
###

Running it works from within Intellij, but nothing is returned, ever.

Can anybody tell me what I am missing here? I am likely wrongfully using the HTTP Client, but I can't find any clear samples from other people trying to do something similar.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source