Noval Agung Prayogo Noval Agung Prayogo -4 years ago 310
HTTP Question

Go - redirect to specific url with payload

I'm currently trying to implements payment method of my client onto my application. To show the payment page, I need to perform request to their url with body information about the payment. The response is html of the payment page. Then I print the html to the view.

But whenever I clicked pay button on the generated view, error occured say that session is invalid, it's because even the payment page is showing up it's still on our host (cross domain problem). I need to click the pay button from their host, it's mean that my application need to be redirected to their host.

Can we redirect to another url but attach body on the header of the request?

I want to redirect to this url "", but including this body request.


How to achieve this?


It's impossible


See ainur answer, I don't understand why, but it's working like a charm

Answer Source

Try to use this code..

	<form action="" method="post" enctype='text/plain'>
		<input type="hidden" name="order" value='<order><corp>NN01</corp><amount>20.0</amount><currency>USD</currency><ordernumber>10010111</ordernumber><redirect></redirect><randomstring>NnwLRINzhOgvmvyunzZIrUtCgvmvy</randomstring><hash>4792e72f5e1860b220420ad3f22f005c9d2fce83f3a138336869780153145700</hash></order>'>
		<button type="submit">Submit</button>

May it solve your problem..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download