Code Samples - acastaner/harnet GitHub Wiki
To parse a .har file, you need to use the HarConverter class and import the file as a string:
Log datLog = HarConverter.ImportHarContent(File.ReadAllText(filePath));
Once this is done, the file is parsed!
In HAR, an 'Entry' is a Request/Response pair. A Log usually contains several entries, saved under Log.Entries (which is of type List<Entry>
)
int entriesCount = datLog.Entries.Count;
foreach (Entry entry in harLog.Entries) { stuff }