0

Nodejs, express. I have form like this:

<form action="https://anothersite.com/post" method="POST">
      <input type="hidden" name="field1" value="val1">
      <input type="hidden" name="field2" value="val2">
      <button type="submit">Send</button>
</form>

I need this one:

<form action="/mypost" method="POST">
      <button type="submit">Send</button>
</form>

..that means I send empty post to page /mypost on my server and question: how to redirect to another server in backend with sending post data?

sirjay
  • 1,767
  • 3
  • 32
  • 52
  • possible duplicate of [ExpressJS : How to redirect a POST request with parameters](http://stackoverflow.com/questions/17612695/expressjs-how-to-redirect-a-post-request-with-parameters) – apairet Aug 26 '14 at 04:25
  • thank you for answer. the second options `request` doesn't work, it says `Error: Hostname/IP doesn't match certificate's altnames` as I use https://... The first options redirects, but i can not modify and set my posts in backend code. Only posts from html code. – sirjay Aug 26 '14 at 06:54
  • You can refer [here](http://stackoverflow.com/questions/32138748/pipe-a-uploaded-file-to-a-remote-server-with-node-ideally-with-same-filename) I think this will help you. – Akshay Kumar Dec 17 '16 at 10:43

0 Answers0