Skip to content

Instantly share code, notes, and snippets.

@wernersmit
Created April 11, 2017 11:37
Show Gist options
  • Save wernersmit/a64b12aafe41923b5eed1e1cda13a72f to your computer and use it in GitHub Desktop.
Save wernersmit/a64b12aafe41923b5eed1e1cda13a72f to your computer and use it in GitHub Desktop.
Relay backend post in Classic ASP - vbscript
<%
' Compile QueryStirng From POST
DataToSend = ""
For Each Item In Request.Form
fieldName = Item
fieldValue = Request.Form(Item)
DataToSend = DataToSend & fieldName & "=" & fieldValue & "&"
Next
'Response.Write "DataToSend: " & DataToSend
'Response.End
dim xmlhttp
set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://example.com/api/post",false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send DataToSend
Response.ContentType = "text/json"
Response.Write xmlhttp.responseText
Set xmlhttp = nothing
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment