I would like to select requests in a HAR file that match certain properties (e.g. POST requests to URL's matching certain parameters) and then examine the request and response data for this.
How can I do this?
Research
- I searched on github for code that deals with this problem
- I searched on kaggle for notebooks that deal with HAR files - and didn't find any - since these notebooks might deal with display issues.
Possible approaches
- Chrome's network tag can perform certain filters, such as filtering to certain mime types, external requests, and searching the URL. However, if cannot filter by POST.
jq
is a specialised command line tool to filter json, that can be used for some ad hoc filtering.
The following jq query will find POST
requests with url's contain sign, but it's rather difficult to look at the result
cat data.har | jq '.log.entries[] | select(.request.method == "POST") | select(.request.url| contains("sign")) | less'