Using REST with RESTEasy and Swagger, is there any way to stream data back to the caller with a GET endpoint? I've seen a couple of examples where the entire stream can be returned, but I haven't seen any examples where the data can actually be streamed back. I also did have a look at this example(followed from this link-Return File From Resteasy Server) however, this example looks like it is returning a stream and expecting the caller to utilize the stream? Is this a correct assumption?:
@GET
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Path("/stream/test")
public Response getTestStream() {
String myName = "name";
InputStream stream = new ByteArrayInputStream(myName.getBytes(StandardCharsets.UTF_8));
return Response.ok().entity(stream).build();
}
But this does not seem to work for me. I get an exception: javax.ws.rs.NotAcceptableException: RESTEASY003635: No match for accept header.
Any help would be greatly appreciated!