Page redirection not working with body request in NodeJS

Viewed 20

I have created a API which I'm using for submitting request bodies and redirecting to another page with that request bodies, but I'm not redirecting to that page. how to redirect a user to another page with request bodies?

Here's my code

const request = require('request')
const request_body = {
        name: 'steve',
        age: 65,
        city: New York
         }
const request_options = {
      method: "POST",
      headers: {
            "Content-Type": "application/json",
            accept: "application/json"
                    },
      uri: `https://somewebsite.com`,
      body: JSON.stringify(request_body)
  }

request.post(request_options)
0 Answers
Related