HarSharp icon indicating copy to clipboard operation
HarSharp copied to clipboard

Create HAR from raw requests and responses

Open vbisbest opened this issue 5 years ago • 3 comments

I am looking for the ability to convert network traffic from Chrome into an HAR file. I have the requests and responses. Is it possible to use this library to create an HAR log file? Thanks!

vbisbest avatar Mar 19 '20 19:03 vbisbest

The library does not serialize HAR entities back to HAR file, but the Chrome already support write the requests and responses to a HAR file:

image

giacomelli avatar Mar 19 '20 19:03 giacomelli

Thank you for your response. I need to be able to generate a HAR file from code. I am launching a Chrome browser and as the user browses around, I need to create a HAR file of the requests/responses (or even after the user is done browsing around). Selenium Webdriver does not support this and it seems no one has found a solution that isnt dirty. So I am looking to take the requests/response from the chrome events and make the HAR file myself.

vbisbest avatar Mar 19 '20 19:03 vbisbest

A feature would be great if you added a constructor for a HAREntry that takes a Chrome network event and converts it to a HAR entry. var entry = new HAREntry(request, response)

vbisbest avatar Mar 19 '20 20:03 vbisbest