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

219
Views
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
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!