title: How to retrieve pdf from remote server and return it as a koa response?
body: <p>I have a node app using koa, and trying to retrieve remote pdf, and return it as a response of my koa request. Here is the code:</p>
  
  <pre><code>router.get('/pdf', function *() {
      const url = 'http://example.com/pdf'
      const res = yield request(url)
      this.status = res.statusCode
      Object.keys(res.headers).forEach(key =&gt; {
        this.set(key, res.headers[key])
      })
      this.body = res.body
  })
  </code></pre>
  
  <p>I get the pdf with blank page, but it should have content in it. Does anyone have an idea what could be the solution?</p>