这是我的代码
unirest.post(url)
.headers({
'Accept': 'application/json',
'Content-Type': 'application/json'
})
.auth(this.auth)
.timeout(global.timeout)
.send({
'username': this.username,
'token': this.token
});
它总是生成content-length
头。如何避免单调自动设置content-length标头?
答案 0 :(得分:0)
content-length标头是保持HTTP连接的持久性所必需的。 因此最好保持自动设置。 同样,unirest没有任何手动设置内容长度的选项。