Getting ' bad_request invalid_json' error when trying to insert document into CouchDB from Node.js

I'm trying to insert a document into CouchDB. While executing this code CouchDB returns the following error:

STATUS: 400    
BODY: {"error":"bad_request","reason":"invalid_json"}    

My code:

var http = require('http')


var options = {
"host": "localhost",
"port": "5984",
"path": "/chinese",
"headers": {"content-type": "application/json"},
"method": "PUT",
"body": JSON.stringify({
    "_id":"rabbit",
    "_rev":"2-c31d8f403d44d1082b3b178ebef8d329",
    "Subject":"I like Plankton"
})
};

var req = http.request(options, function(res) {
  console.log('STATUS: ' + res.statusCode);
  res.setEncoding('utf8');
  res.on('data', function (chunk) {
    console.log('BODY: ' + chunk);
  });
});

req.write('data\n');
req.end();

What's wrong?

EDIT: I need to update data, so I replaced POST to PUT.

Because you are writing 'data\n' as the body of your request, and that's not valid JSON indeed.

Probably, you meant:

req.write(JSON.stringify({"data": "somedata"}));

instead of passing this as the body parameter of the options.