title: Post request that returns a download file
body: <p>I am sending data to my server that creates a pdf file based from the request, which is being created fine but I cant get the file to be sent back to the client. I am using React to submit the form</p>
  
  <pre><code>handleSubmit(event) {
  event.preventDefault();
  var body = {
    id: this.state.id,
    text: this.state.text
  }
  fetch('http://localhost:5000/pdf', {
              method: 'POST',
              body: JSON.stringify(body),
              headers: {
                  'Content-Type': 'application/json'
              },
          }).then(function(file) {
            window.open(file.url);
          });
  }
  </code></pre>
  
  <p>Its opening <a href="http://localhost:5000/pdf" rel="noreferrer">http://localhost:5000/pdf</a>, but since I don't have a GET route for it, nothing gets download. This is my POST route</p>
  
  <pre><code>router.post('/pdf', async function(req, res) {
    var makePdf = require('./file-create/pdf.js');
    makePdf(req, res);
  });
  </code></pre>
  
  <p>and the file is being returned as   <code>pdfDoc.pipe(res);</code></p>
  
  <p>I cant just use a GET route because I can't get data sent in with that way, how can I get this file to get sent to the client?</p>