idReplacement not work
Author: Rickyc81Created Jun 10, 2025Updated Feb 17, 2026
hi, this is my simple code for test idReplacement, but not work and generate this error on my express server
BadRequestError: request aborted
at IncomingMessage.onAborted (C:\Users\ricca\Desktop\express\node_modules\raw-body\index.js:245:10)
at IncomingMessage.emit (node:events:518:28)
at IncomingMessage._destroy (node:_http_incoming:221:10)
at _destroy (node:internal/streams/destroy:122:10)
at IncomingMessage.destroy (node:internal/streams/destroy:84:5)
at abortIncoming (node:_http_server:809:9)
at socketOnClose (node:_http_server:803:3)
at Socket.emit (node:events:530:35)
at TCP.<anonymous> (node:net:351:12)this is the autocannon file:
const autocannon = require('autocannon');
autocannon({
url: 'http://localhost:3000/test',
idReplacement: true,
connections: 1,
amount: 1,
duration: 5,
requests: [
{
method: 'POST',
path: '/test',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'New User',
email: 'new-[<id>]@user.com'
}),
}
]
});
if i disable idReplacement the request works fine.. what am I doing wrong?
Thanks!!
Source: mcollina/autocannon