Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I construct RAW request from an HAR (HTTP Archive) file?

Tags:

http

archive

har

Since a request can have postData and the different mimeType behave differently, What is the best way to reconstruct the RAW Request from HAR format.

Note: I'm using C#, but any solution\tip regardless of the programming language would be great.

like image 960
Idan Slonimsky Avatar asked Dec 03 '25 10:12

Idan Slonimsky


1 Answers

As a starting point, you could use an external library such as HarSharp.

Taking the examples from the github page:

Deserialize from string:

var har = HarConvert.Deserialize(harContent);

Where harContent is a string from your HTTP Archive file.

Deserialize from file

var har = HarConvert.DeserializeFromFile(fileName);

Where fileName is the path to your HTTP Archive file.

I'm personally looking at this library but I wish to do the reverse - generate a HAR file from the HttpContext. But I can't see anything to do that.

like image 167
Dan Atkinson Avatar answered Dec 05 '25 00:12

Dan Atkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!