encodeHttpBatch

fun <T> encodeHttpBatch(packets: List<EngineIOPacket<T>>, serializePayload: (T) -> String): String(source)

Encodes the given list of EngineIO packets to a text, which can be used as the body of an HTTP batch request.

For each EngineIOPacket.Message packet, the payload is serialized using the provided serializePayload function.

This is meant to be used in HTTP long-polling mode, where packets are batched in a single HTTP request. When using web sockets, use encodeWsFrame on each frame instead.