我怎样才能加载使用'loadtest'nodejs模块testing后期API?

我正在使用loadtest nodejs模块来testingnodejs脚本中API的压力testing。 Get调用语法正在工作,但是后调用不。 代码如下。

function optionsObject() { return { url: 'http://localhost:3000/api/v2/signup', maxRequests: 1, concurrency: 1, method: 'POST', contentType: 'applicaton/json', body: { password: 'test', email: 'testobject_1@signup2.com', name: 'kPYgJ6Rg5wnExt8hTXQIHDn2LaCMsytjhQzp' } } 

}

 loadtest.loadTest(optionsObject(), function (error, result) { if (error) { console.log('Got an error: %s', error); } else { console.log(result); } }); Results: { totalRequests: 1, totalErrors: 1, totalTimeSeconds: 0.025545716, rps: 39, meanLatencyMs: 20, maxLatencyMs: 20, percentiles: { '50': 20, '90': 20, '95': 20, '99': 20 }, errorCodes: { '400': 1 } } 

任何人都可以帮助,为什么我得到错误的请求错误400?

内容types的声明有一个错字。 (第二我失踪了。)

使用

 contentType: 'application/json', 

相反,那么它的作品。