title: Chai POST send binary file
body: <p>I need to test a file upload, without using multi part form data.</p>
  
  <pre><code>it('Create node', () =&gt; {
      return chai.request(server)
          .post('/api/sensornodes')
          .set('Content-Type', 'application/json')
          .send(fs.readFileSync('test/manifest/sensor_nodes.json'))
          .then((res) =&gt; {
              expect(res.status).to.eql(204);
          });
  });
  </code></pre>
  
  <p>This test call the below endpoint, where I'm using the body-parser to parse the request</p>
  
  <pre><code>public create(req: Request, res: Response, next: NextFunction) {
      console.log("req body", req.body)
  }
  </code></pre>
  
  <p>But when I execute the test the <code>req.body</code> is a an object like this, not as I'm expecting</p>
  
  <pre><code>{ 
      type: 'Buffer',
      data:
         [ 123,
           10,
           32,
           32,
           32,
           ...
         ]
  }
  </code></pre>
  
  <p>When I call that endpoint through Postman, everything it's ok and in the <code>req.body</code> I have the content of the .json </p>
  
  <p>Where I am wrong?</p>