R
Rippo
Hi
I need to post a form to an external URL, get a repsonse, then repost
to an external URL and redirect at the same time. I can figure out step
1 and step 2 fine but I cant seem to figure out how to send a form and
send the client to the external url at the same time. Can anyone help?
'Step 1 create form data
Dim formPostData As String = String.Empty
formPostData &= "AmountPaid=" & Booking.AmountPaid
formPostData &= "Fullname=" & Booking.Fullname
'Step 2 send to XXXX and get response
client = New Net.WebClient
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
postByteArray = Encoding.ASCII.GetBytes(formPostData)
responseArray = client.UploadData(PaymentURL, "POST", postByteArray)
response = Encoding.ASCII.GetString(responseArray)
'step 3 recreate form and send on to exteranl url
formPostData = "epdqData=" & response
client = New Net.WebClient
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
postByteArray = Encoding.ASCII.GetBytes(formPostData)
client.UploadData(PaymentURL, "POST", postByteArray)
HOW DO I SEND CLIENT ON TO EXTERNAL URL HERE?
many thanks
Rippo
I need to post a form to an external URL, get a repsonse, then repost
to an external URL and redirect at the same time. I can figure out step
1 and step 2 fine but I cant seem to figure out how to send a form and
send the client to the external url at the same time. Can anyone help?
'Step 1 create form data
Dim formPostData As String = String.Empty
formPostData &= "AmountPaid=" & Booking.AmountPaid
formPostData &= "Fullname=" & Booking.Fullname
'Step 2 send to XXXX and get response
client = New Net.WebClient
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
postByteArray = Encoding.ASCII.GetBytes(formPostData)
responseArray = client.UploadData(PaymentURL, "POST", postByteArray)
response = Encoding.ASCII.GetString(responseArray)
'step 3 recreate form and send on to exteranl url
formPostData = "epdqData=" & response
client = New Net.WebClient
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
postByteArray = Encoding.ASCII.GetBytes(formPostData)
client.UploadData(PaymentURL, "POST", postByteArray)
HOW DO I SEND CLIENT ON TO EXTERNAL URL HERE?
many thanks
Rippo