Skip to content

Vitineth/harv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

harv - A nice HAR viewer

harv is designed as a very simple little command line tool that prints details about the contents of HAR files.

This parses files according to the Historical HAR Draft v14 and should generally support it. This has not been tested against all types of HAR files generated by different browsers and some may implement some slight differences (ie Chrome drops contents over a certain size). Error handling isn't gracefully done currently so you may run into raw JSON deserialization errors. See the section on my HAR file doesn't work for more info.

Usage

The command line help is generally self-explanatory but is copied here for completeness.

$ harv
Usage: harv <file>

A simple command line HAR file viewer

Arguments:
  <file>    The HAR file to parse

Flags:
  -h, --help                                               Show context-sensitive help.
  -D, --request-domain=REQUEST-DOMAIN                      Find results where the domain equals this value
  -d, --request-domain-includes=REQUEST-DOMAIN-INCLUDES    Find results where the domain contains this value
  -P, --request-path=REQUEST-PATH                          Find results where the request path equals this value
  -p, --request-path-includes=REQUEST-PATH-INCLUDES        Fina results where the request path includes this value
  -b, --request-has-body                                   Find results where the request has a body
  -B, --response-has-body                                  Find results where the response has a body
  -m, --method-in=METHOD-IN                                Find requests where the method is one of the provided values
  -c, --response-code=RESPONSE-CODE                        Find requests where the response code is equal to the value
  -i, --response-informational                             Find requests where the response was successful
  -s, --response-success                                   Find requests where the response was successful
  -f, --response-fail                                      Find requests where the responses was unsuccessful
  -H, --print-headers                                      If specified, the request and response headers (excluding Cookie headers, use -C for that) will be included in the output
  -C, --print-cookies                                      If specified, the request and response cookies will be included in the output
  -u, --print-request-body                                 If specified, include the body of the request, including JSON highlighting
  -U, --print-response-body                                If specified, include the body of the response, including JSON highlighting
  -t, --print-timings                                      If specified, include the request timings

Example

An example HAR file for a request to https://example.org using a file exported from Chrome and invoked with the command harv file.har -HCuUt

image

My HAR File Doesn't Work

If you have a HAR file that doesn't work properly, please raise an issue with the error message. You should not include the HAR file in your upload. As HAR files contain all details of the request, including cookies, it can contain sensitive materials. You should first check your HAR file for any details that should be removed, and if you are comfortable, submit it through an out of band system that only I can access. Once the errors are resolve and your file processes correctly, the file will be completely deleted.

About

A simple HAR viewer CLI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages