Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

220
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda