title: Accepting response of res.write() from browser
body: <p>I'm trying to implement a payment gateway from my back-end and I'm using 'payhere' checkout-api which is an external payment api. After sending a post request to the API it's supposed to redirect the user to the checkout page of payhere. But since I'm doing this through my own back-end api of my project I'm using the following method</p>
  
  <pre><code>res.set(data.headers);
  res.write(data.body);
  res.end();
  </code></pre>
  
  <p>the code worked fine when I called my own api through postman but when I tried it with a html file I created locally on my machine it does't display anything. The code of my html file is as follow</p>
  
  <pre><code>fetch('https://digicense-api.herokuapp.com/users/fines/pay', {
                  method: 'POST',
                  redirect: 'follow',
                  headers: {
                      'Content-Type': 'text/html',
                      'Authorization': 'Bearer _token_',
                  }
              }).then(function (res) {
                  console.log(res)
                  return JSON.parse(res)
              }).then(function (data) {
                  console.log(data.json())
              })
  </code></pre>
  
  <p>How do I fix this so that the browser will display the page that is redirected by the external api? Thanks in advance!</p>