$.post and nodeJS problem. (Never Success)

$.post and nodeJS problem. (Never Success)

Hi,

I have a problem with a $.post.

I send a JSON file to my nodeJS server and it is well received by the server. (I can handle it with NodeJS)

But client-side, I never have the success of the $.post.

  1.     saveJSONtoServer : function()
        {
            var self = this;
            var JSONvar = self.makeJSON();

            $.ajax(
            {
                url: "/handlerJSONentrySaver",
                type: "POST",
                data: JSONvar,
                dataType: "json",

                success: function(data)
                {     
                    alert("OK");
                },

                beforeSend: function(x)
                {
                    if (x && x.overrideMimeType)
                        x.overrideMimeType("application/j-son;charset=UTF-8");
                }

            });

        },

























I have this code server-side :
  1. app.post("/handlerJSONentrySaver", function(req, res)
  2.     {
  3.         console.log(req.body);

  4.         res.writeHead(200,{"Content-Type" : "text/html"});
  5.         res.end("OK");
  6.     });

Hope you can help me.

Thanks in advance.