Idan Slonimsky
Idan Slonimsky

Reputation: 61

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

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.

Upvotes: 3

Views: 566

Answers (1)

Dan Atkinson
Dan Atkinson

Reputation: 11728

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.

Upvotes: 1

Related Questions