title: How to receive a converted file from microsoft graph api
body: <p>I'm having a problem saving a pdf I am receiving from microsoft graph api. I am making the following call using the configuration I construct:</p>
  <pre><code>const convertConfig = {
      headers: {
          Authorization: &lt;my token&gt;
      }
  };
  convertConfig.headers['Content-Type'] = 'application/pdf';
  const convertRes = await axios.get(`https://graph.microsoft.com/v1.0/&lt;myTenantId&gt;/sites/&lt;mySite&gt;/drive/root:/&lt;myPath&gt;:/content?format=pdf`, convertConfig);
  </code></pre>
  <pre><code>{
    status: 200,
    statusText: 'OK',
     
    ... // snipped data 
  
    data: &lt;pdf data here as a string in the form 
      '%PDF-1.7\r\n' +
      '%����\r\n' +
      '1 0 obj\r\n' +...&gt;
  }
  </code></pre>
  <p>However, when manually saving this file or uploading it, the pdf ends up blank but with the proper amount of pages. For instance, I can save it like so:</p>
  <pre><code>fs.writeFileSync('some.pdf', convertRes.data);
  </code></pre>
  <p>and the resulting pdf saved is just blank white pages.</p>
  <p>Here's my main question, somewhere I am misusing this data or not asking for something properly because when I make the request using postman the response actually has the content!</p>
  <p><a href="https://i.stack.imgur.com/WAcx4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WAcx4.png" alt="params" /></a>
  <a href="https://i.stack.imgur.com/fb21X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fb21X.png" alt="headers" /></a></p>
  <p>Is there something I am not including in the call or something I'm not doing to the data to handle it properly as pdf data?</p>