HarPostDataExtensions Class

Provides helper methods for working with HAR post data payloads.

public static class HarPostDataExtensions

Methods

NameDescription
TryGetRawData(HarPostData?, byte[]?, string)Gets the raw payload bytes represented by the HAR post data.

TryGetRawData(HarPostData?, byte[]?, string)

HarPostDataExtensions.cs

Gets the raw payload bytes represented by the HAR post data.

public static bool TryGetRawData(this HarPostData? postData, out byte[]? rawData, string encodingExtensionName = "x-meziantou-encoding")

Parameters

postData HarPostData?
The HAR post data.
rawData byte[]?
The decoded raw bytes if available.
encodingExtensionName string
The extension field name containing the encoding metadata.

Returns

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

Constants

NameDescription
DefaultEncodingExtensionNameDefault extension field name used to store the post data encoding.

DefaultEncodingExtensionName

Default extension field name used to store the post data encoding.

public const string DefaultEncodingExtensionName = "x-meziantou-encoding"