I have in my backend defined:
var proxy = proxyMiddleware('/api', {
target: 'http://somehost.zero',
proxyTable: {
'/api/one': 'http://somehost.one',
'/api/two': 'http://somehost.two',
}
});
app.use(proxy);
and when I'm proxing POST request (lets say to the '/api/one': 'http://somehost.one' ) I don't know why but server http://somehost.one get request without body.
Did you had similar problem?
I have in my backend defined:
and when I'm proxing POST request (lets say to the '/api/one': 'http://somehost.one' ) I don't know why but server http://somehost.one get request without body.
Did you had similar problem?
Did a little test and I am able to receive POST data at the
targetserver.I noticed you are using the
body-parsermiddleware:https://github.com/dejewi/proxy-bug/blob/master/app.js#L16
Option 1:
You might want to change to order of the middlwares you are using.
Try moving the
http-proxy-middlewareabove thebody-parserOption 2:
Use
fixRequestBody:Hope this solves the issue.