<%
Dim post : post = Request.Body
Response.COntentType= "text/plain"
Response.Write "Your " & Request.ServerVariables("REQUEST_METHOD") & " data was: " & post
%>
raw-form-test1.asp:
raw-form-test2.asp:
<%
Dim data : data = Request.Form("data")
Dim resp : resp = ""
If data <> "" Then
Dim http : Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
http.Open "post", "http://localhost:8080/raw-form.asp"
http.Send data
http.WaitForResponse(10)
resp = http.Status & " | " & http.ResponseText
End If
%>
<%= Server.HTMLEncode(resp) %>
<%
If Request.TotalBytes > 0 Then
Response.COntentType= "text/plain"
Response.Write "Your " & Request.ServerVariables("REQUEST_METHOD") & " data was: "
Response.BinaryWrite Request.BinaryRead(Request.TotalBytes)
End If
%>
<%
If Request.TotalBytes > 0 Then
Dim lngBytesCount, post
lngBytesCount = Request.TotalBytes
post = BytesToStr(Request.BinaryRead(lngBytesCount))
Response.COntentType= "text/plain"
Response.Write "Your " & Request.ServerVariables("REQUEST_METHOD") & " data was: " & post
End If
Function BytesToStr(bytes)
Dim Stream
Set Stream = Server.CreateObject("Adodb.Stream")
Stream.Type = 1 'adTypeBinary
Stream.Open
Stream.Write bytes
Stream.Position = 0
Stream.Type = 2 'adTypeText
Stream.Charset = "iso-8859-1"
BytesToStr = Stream.ReadText
Stream.Close
Set Stream = Nothing
End Function
%>