diff --git a/Readme.md b/Readme.md index d6a69cf..9c0cddd 100644 --- a/Readme.md +++ b/Readme.md @@ -22,6 +22,8 @@ each property corresponds to specific settings for that given url. The options available for each url are the same as those available to `http.request` (http://nodejs.org/api/http.html#http_http_request_options_callback). +When using the configuration setting `headers` you *must* provide the value as a valid JSON string. + ### Example ```ini [localhost] @@ -31,6 +33,7 @@ num = 5 [localhost/submit] port = 8000 data = this is a test +headers = {"some": "values"} method = post num = 2 diff --git a/lib/index.js b/lib/index.js index 4ade422..bc6e7a4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -104,6 +104,9 @@ var errors = []; var errors_length = 0; var urls = []; for( var key in config.urls ){ + if(config.urls[key]['headers']){ + config.urls[key]['headers'] = JSON.parse(config.urls[key]['headers']); + } var url = config.urls[key]; for( var i = 0; i < url.num; ++i ){ urls.push(url);