title: Request js library Unexpected end of JSON input
body: <p>I am running server on node.js and Express v4.0</p>
  
  <p>And i am using request <a href="https://github.com/request/request" rel="nofollow">library</a>
  Uncaught SyntaxError: Unexpected end of JSON input
  then recving response from server i am getting response but without last symbol ("}") so when i try to parse JSON it throws error.
  The problem is that if i do same request with xmlhttprequest from Chrome it works with SAME HEADERS AND SAME BODY</p>
  
  <p>request parametrs:</p>
  
  <pre><code>request({
                      method:"POST",
                      jar:true,
                      url:host+"/api/location",
                      form:{
                          longitude:elem.longitude,
                          latitude:elem.latitude
                      },
                      followAllRedirects:true
                  },(err,res,body)=&gt;{
                      logger.log(body);
                      body = JSON.parse(body);
                      assert(!body.success);
                      assert(body.longitude != elem.longitude &amp;&amp; body.latitude != elem.latitude);
                      done();
                  });
  </code></pre>
  
  <p>response is comming back incorrect code in express:</p>
  
  <pre><code>res.send(JSON.stringify(({
    error:"Unknown",
    errorCode:errorCode,
    success:false,
    "-_-":"_-_"
  })));
  </code></pre>
  
  <p>last fields was a try to send another field and check is other field is malformed or not. and it wasnot malformed but still last symbol not recved.</p>
  
  <p>also i tried to use res.json() with same body but no success. same result.</p>
  
  <p>what i can do? is anyway to find where is problem?</p>