data

Creates a ServerSentEvent with only the data field set.

This is the most common SSE use case. All other fields (event, id, retry, comments) default to null.

mokksy.get(spec -> spec.path("/sse"))
.respondsWithSseStream(builder -> builder
.chunk(SseEvent.data("Hello"))
.chunk(SseEvent.data("World")));

Return

A new ServerSentEvent.

Parameters

data

The event data string.