alexfernandez/loadtest

Request Generator supposed to return request object

zzxoto opened this issue ยท 5 comments

The request generator provided in the options is supposed to return request object (as seen in the line 190 - 193 in the httpClient.js). However this fact is missing (or outdated) in the markdown documentation. The documentation instead has the following:

module.exports = function(params, options, client, callback) {
  generateMessageAsync(function(message) {
 
    if (message)
    {
      options.headers['Content-Length'] = message.length;
      options.headers['Content-Type'] = 'application/x-www-form-urlencoded';
    }
    request = client(options, callback);
    if (message){
      request.write(message);
    }
 
    return request;
  }
}

Package version: "5.0.4"

Well seen! Care to send a pull request? ๐Ÿ˜‰

On it.

Btw, would you like the documentation to be changed, or the api.

What do you think is more useful? I would think that changing the documentation would be best.

I will get back at this with a well thought out answer, might take as long as a week though.

A bit late ๐Ÿ˜“ but the docs have been fixed here: 8220349