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

213
Views
How to call this get api with sending the body using axios?

Hi I can call the the api in the postman like this.

The data return fine in the postman

Image

But when I try to get the api from the axios request the api always give me 500

What am I doing wrong?

axios
    .get('/dwapi/productsapi/GetProductList', {
      params: {
        group: 'Baby&Kids',
        subgroup: '',
        subsubgroup: '',
        pagesize: '',
        pagenum: '4',
        minprice: '',
        maxprice: '',
        brand: '',
        size: '',
        promotion: '',
        bhgexclusive: '',
        sortorder: '',
        sortby: '',
        search: '',
      },
    })
    .then(res => {
      console.log(res);
      // dispatch({
      //    type: FETCH_PRODUCT_LIST,
      //    payload: res.data,
      // });
    })
    .catch(err => {
      throw err;
    });
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

axios
    .get('/dwapi/productsapi/GetProductList', {
        group: 'Baby&Kids',
        subgroup: '',
        subsubgroup: '',
        pagesize: '',
        pagenum: '4',
        minprice: '',
        maxprice: '',
        brand: '',
        size: '',
        promotion: '',
        bhgexclusive: '',
        sortorder: '',
        sortby: '',
        search: '',
      }
    )
    .then(res => {
      console.log(res);
      // dispatch({
      //    type: FETCH_PRODUCT_LIST,
      //    payload: res.data,
      // });
    })
    .catch(err => {
      throw err;
    });
about 4 years ago · Juan Pablo Isaza Report

0

It seems like you want to send your parameters in the body and not the URL parameters, thus you should not be specifying the params property:

axios
    .get('/dwapi/productsapi/GetProductList', {
      group: 'Baby&Kids',
      subgroup: '',
      subsubgroup: '',
      pagesize: '',
      pagenum: '4',
      minprice: '',
      maxprice: '',
      brand: '',
      size: '',
      promotion: '',
      bhgexclusive: '',
      sortorder: '',
      sortby: '',
      search: '',
    })
    .then(res => {
      console.log(res);
      // dispatch({
      //    type: FETCH_PRODUCT_LIST,
      //    payload: res.data,
      // });
    })
    .catch(err => {
      throw err;
    });
about 4 years ago · Juan Pablo Isaza Report

0

In axios, you can try with data instead of params. And let me know what will be the result.

axios
    .get('/dwapi/productsapi/GetProductList', {
      data: {
        group: 'Baby&Kids',
        subgroup: '',
        subsubgroup: '',
        pagesize: '',
        pagenum: '4',
        minprice: '',
        maxprice: '',
        brand: '',
        size: '',
        promotion: '',
        bhgexclusive: '',
        sortorder: '',
        sortby: '',
        search: '',
      },
    })
    .then(res => {
      console.log(res);
      // dispatch({
      //    type: FETCH_PRODUCT_LIST,
      //    payload: res.data,
      // });
    })
    .catch(err => {
      throw err;
    });
about 4 years ago · Juan Pablo Isaza Report
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!