The HTTP archiving (HAR) file transfer tool.
Welcome to the harcurl homepage.
In order to understand what harcurl is, there are some prerequisites you should know:
All of these are used together in harcurl to make the tool easier to use. There are several goals of the harcurl project:
For example, instead of typing all of the arguments on the command-line, as some people do, you can capture a HAR request and HAR response with Chrome or Firefox and copy-and-paste the request to input into harcurl, and since it's the same format you don't have to edit much (except perhaps the Date header).
The only way to get harcurl right now is to build it from source. The source code is available from GitHub or the link above.
git clone https://github.com/andydude/harcurl.git
Make sure you have libcurl, jansson, glib, and zlib installed, then (in the harcurl directory) run
./autogen.sh && ./configure && make && sudo make install
There are some examples in the tests directory to get you started.
The harcurl tool accepts requests on stdin, and prints responses to stdout. The format of the request and response are both specified in the HAR-1.2 specification. Obviously, almost every property is optional on input, even though the HAR spec says it is required, since one of the jobs of harcurl is to fill in the rest of the data from the response. The only 2 properties that are required are method and url.
The recommended usage is to build a JSON file either by hand, or by generating one with your favorite programming language, then feed that to harcurl on stdin.
echo ' { "request" { "method": "GET", "url": "http://httpbin.org/get" } }' | harcurl
The simplest way to use harcurl is to call it with the shell command:
harcurl < req.json > resp.json
There are some differences between HAR-1.2 and the input format to harcurl. For reference, we can call this new format "HAR-1.3-alpha" or something.
One major difference is that almost everything is optional on input, because most of the fields are filled in by harcurl. There are also some properties that are NOT specified by HAR-1.2, but are meaningful to harcurl. For example:
-v
option is given)-v
option is given)-v
option is given)-v
option is given)