Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Axios request not acting like Postman request?

I'm trying to grab the HTML content of a page, after submitting form data as part of the request. In Postman, I make a POST request to https://forms.n-somerset.gov.uk/Waste/CollectionSchedule with the following x-www-form-urlencoded data

  'Postcode': '-',
  'SelectedUprn': '24011054',
  'PreviousPostcode': '-',
  'PreviousHouse': ''

In Postman, I can see the page has the correct data loaded into it: enter image description here

If I then take the generated Axios request from Postman and run this in Node, the HTML content of the page is different, in that it shows the form which would show if you made a GET request instead

var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'Postcode': '-',
  'SelectedUprn': '24011054',
  'PreviousPostcode': '-',
  'PreviousHouse': '' 
});
var config = {
  method: 'post',
  url: 'https://forms.n-somerset.gov.uk/Waste/CollectionSchedule',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded', 
    'Cookie': 'ASP.NET_SessionId=ozx3vvgzsa1tq4okyllzmway'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Does anyone know why the request in Postman works, but doesn't in Node using Axios?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!