title: How to send POST to MongoDB Atlas using HTTPie?
body: <p>I'm attempting to test my REST API by making a POST request to a MongoDB cloud Atlas DB server. I know Postman is available, but I wanted to use something different like Httpie. I already checked this question but I'm still stuck. <a href="https://stackoverflow.com/questions/33128993/how-to-send-a-post-request-using-httpie">
  How to send a POST request using HTTPie?</a> </p>
  
  <p>I'm trying to get <code>text='john smith'</code></p>
  
  <p>when I use</p>
  
  <pre><code>`http -f POST :5000/api/posts text='john smith'`
  </code></pre>
  
  <p>I get this response. </p>
  
  <pre><code>`HTTP/1.1 201 Created
  Access-Control-Allow-Origin: *
  Connection: keep-alive
  Content-Length: 0
  Date: Tue, 19 Feb 2019 20:33:36 GMT
  X-Powered-By: Express`
  </code></pre>
  
  <p>But when I use...</p>
  
  <p><code>http -f GET :5000/api/posts</code></p>
  
  <p>I get back ...</p>
  
  <pre><code>`[
     {
          "_id": "5c6c6820c2f6eb15ea9e8e08",
          "createdAt": "2019-02-19T20:33:36.468Z",
          "text": null
      }
  ]`
  </code></pre>
  
  <p>This is my Nodejs API for the post</p>
  
  <pre><code>router.post('/', async(req, res) =&gt; {
      const posts = await loadPostCollection();
      await posts.insertOne({
          text: req.body.text,
          createdAt: new Date()
      });
      res.status(201).send();
  });
  </code></pre>