Closed NoelAbrahams closed 10 years ago
Also I think we need to set the response encoding:
var result = ""
res.setEncoding('utf8');
res.on('data', function(chunk) {
Thanks for the bug report, I've fixed and push to npm.
Hi,
I ran into a problem when attempting to commit a document containing accent characters.
I've traced the problem down to how the
Content-Length
header is initialised. Setting this topayload.length
works most of the time, but when there are non-English characters the length is understated, causing Azure search to reject the request as malformed JSON.To fix this please replace headers as follows (I've also added the charset to the headers):