HarTraffic

static class · namespace z3n7 · source Traffic/Har.Rqst.cs, Traffic/Har.cs

public static class HarTraffic

HAR 1.2 export of browser traffic (GetTraffic) and of saved Rqst traffic.

Methods

ExportRqst

public static string ExportRqst(IZennoPosterProjectModel project, string projectFilter = null, string taskId = null)

source

Exports all complete saved Rqst transactions as a HAR 1.2 JSON document.

FromRqstJsonl

public static string FromRqstJsonl(string path, string projectFilter = null, string taskId = null)

source

Converts the Rqst traffic file at path to a HAR 1.2 JSON document. Only what Rqst recorded is available: timings hold the total duration only, binary bodies are text.

Parameter Description
path Traffic file written by ZpTraffic.
projectFilter Keep only records of this project.
taskId Keep only records of this task.

Save

public static int Save(Instance instance, string path, string filter = null)

source

Writes the active tab's traffic to a HAR 1.2 file, replacing an existing file. Response bodies are decoded (gzip, deflate; brotli and zstd when Brotli.Core or ZstdNet are loaded); text types are stored as text, others as Base64. Items that cannot be converted are skipped. Timings and start times are approximate: ZennoPoster gives only the total time.

Parameter Description
instance Browser instance.
path Target file; must end with .har. Missing folders are created.
filter URL filter for GetTraffic; default is the active tab's domain.

Returns: Number of entries written.