featherbit UI
    Preparing search index...

    Function bodyText

    • Finds the most recent captured body text at or before stepIndex.

      Bodies are only captured (as text) when they change; unchanged bodies are marked unchanged: true with no text, so this walks backwards through step snapshots while a body stays unchanged with no text, stopping at the first text found, at trace.initial, or at a step whose body changed but wasn't captured as text (binary/too large) — in which case there is nothing valid to backfill from and the result is null.

      Parameters

      • trace: TraceDetail
      • stepIndex: number

        Index into trace.steps to start from; -1 means "no step yet" (the listener predecessor case), starting the search at trace.initial directly.

      • which: "request" | "response"

      Returns string | null