Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.23 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.23 KB

HAR to cURL

Written in JavaScript. CommonJS format. Inspired by a Python implementation.

💬 Try the web interface.

Install

You'll need Component and GNU make to build the standalone browser version. Then run:

git clone https://github.com/mattcg/har-to-curl.git
cd har-to-curl/
make
ls -l build/

Alternatively, use Component to install to your project.

component install har-to-curl

You can also use Bower.

bower install har-to-curl

And npm.

npm install har-to-curl

Example

var harToCurl = require('har-to-curl');

var myHarString = '{"startedDateTime": "2013-02-21T16:23:17.806Z", "time": 577, "request": { "method": "GET", "url": "http://...';
var myCurlCommand;

// Passing in an object:
var myHarObject = JSON.parse(myHarString);
myCurlCommand = harToCurl(myHarObject);

// Passing in a string - will be JSON.parsed automatically:
myCurlCommand = harToCurl(myHarString);

License

Copyright © 2012 Matthew Caruana Galizia, licensed under an MIT license.