HarContentExtensions Class

Provides helper methods for working with HAR response content payloads.

public static class HarContentExtensions

Methods

NameDescription
TryGetRawData(HarContent?, byte[]?)Gets the raw payload bytes represented by the HAR content.

TryGetRawData(HarContent?, byte[]?)

HarContentExtensions.cs

Gets the raw payload bytes represented by the HAR content.

public static bool TryGetRawData(this HarContent? content, out byte[]? rawData)

Parameters

content HarContent?
The HAR content.
rawData byte[]?
The decoded raw bytes if available.

Returns

bool true when payload bytes are available; otherwise, false. Returns false when the text is not valid for the declared HarContent.Encoding, or when that encoding is not understood, rather than reporting the undecoded text as the payload.