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

222
Vistas
http proxy middleware changes method From 'POST' to 'GET' on redirect

I'm using http-proxy-middleware in my recat app as follows

module.exports = function (app) {
       app.use(
            "/api",
           createProxyMiddleware(filter, {
           target: "https://example.com/",
           secure: false,
           changeOrigin: false,
           logLevel: "debug",
           followRedirects: true,
           onProxyReq: (proxyReq, req, res) => {},
           onProxyRes: (proxyRes, req, res) => {
               const exchange = `[${req.method}] [${proxyRes.statusCode}] ${req.path} -> 
             ${proxyRes.req.protocol}//${proxyRes.req.host}${proxyRes.req.path}`;
    console.log(exchange);
  },
           onError: (err, req, res, target) => {
                   console.log(err);
          },
      })
   );
 };

I set followRedirects = true otherwise I get a 301 and then a 405 Method not allowed now I get just the 405 I can see that the request is changed to a 'GET' request which is rejected by the server

this is my request

axios({
     method: "POST",
     data: data,
     url: url,
  }).then(r =>{
        ...
  })
about 4 years ago · Juan Pablo Isaza
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