-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x-www-form-urlencoded #43
Comments
Please provide more information: Can you provide a minimal working example, if you think it is a bug? |
My request export function fetchToken(data) {
let body = {
username: data.email,
password: data.password,
};
return fetch(`/oauth/token`, {
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: JSON.stringify(body)
})
.then((r) => r.json());
} My server.js const proxy = proxyMiddleware(['/api', '/oauth'], {
target: 'http://api.tradeintel.com/',
xfwd: true (meybe???)
});
app.use(proxy); Other requests with 'Content-Type: application\json' is good working. P.S. Sorry for my English. |
Don't see a weird config.. Did you try the const proxy = proxyMiddleware(['/api', '/oauth'], {
target: 'http://api.tradeintel.com/',
changeOrigin: true
}); |
Try checking this thread: #40 (comment) If you are using multiple middlewares, make sure http-proxy-middleware is on top. |
Yeah! // app.use(parser.json());
// app.use(parser.urlencoded({ extended: true })); It works :) |
Np! |
@chimurai After all these years, this issue has cost me quite some time. I think it's worthwhile adding a mention about other default/built-in middleware possibly messing with this one. I understand not everyone uses Express, yet I bet many do, so a few lines in the README would save a bunch of time for many folks and improve the UX overall, I think. ✌️ |
Hi.
Header 'Content-Type: application/x-www-form-urlencoded'
Not working...
Error:
[HPM] Proxy error: ECONNRESET. localhost -> "api.*.com/oauth/token"
The text was updated successfully, but these errors were encountered: