Browse Source

#2 - can now add headers as JSON string in configuration file

master
Brett Langdon 13 years ago
parent
commit
9f670d8fed
2 changed files with 6 additions and 0 deletions
  1. +3
    -0
      Readme.md
  2. +3
    -0
      lib/index.js

+ 3
- 0
Readme.md View File

@ -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


+ 3
- 0
lib/index.js View File

@ -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);


Loading…
Cancel
Save