toBytes

fun toBytes(comments: List<String> = emptyList()): ByteArray(source)

Serialises the fixture in the .http format.

Return

the file's bytes: the comments, the status line with the common reason phrase, the headers in order, a blank line and the body verbatim.

Parameters

comments

provenance lines written as # <comment>, each without CR or LF; none by default.

Throws

if a comment contains CR or LF.