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

344
Views
How can I get proper axios.post data, not html-format code?

After axios.post, response.data only return html code and what I sent is in response.config.data. Moreover, in the server side, console.log is not working but in vscode console, it returns POST /tagSearch 200 95.325 ms - -

I'm using express and nextjs. Plz help me.....

response

Here's my code.

client side, pages/tagSearch.js

const onClick = () => {
    axios.post('http://localhost:3060/tagSearch', {
      "id": 7,
      "name": 'mango'
    },
      {
        headers: { "Content-Type": `application/json` }
      }
    )
      .then((res) => {
        console.log(res);
      }
      )
  }

server side, app.js

var express = require('express');
var app = express();

var tagSearchRouter = require('./routes/tagSearch');

app.use('/tagSearch', tagSearchRouter);

module.exports = app;

server side, routes/tagSearch.js

router.post('/', (req, res) =>{
    console.log(req.body);
})
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!