(Classic ASP) Inspect HTTP Request Header
Demonstrates the LastHeader property.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set http = Server.CreateObject("Chilkat.Http")
url = "https://chilkatsoft.com/echo_request_body.asp"
json = "{""greeting"":""Hello World""}"
' Send a POST with the JSON in the HTTP request body.
set resp = Server.CreateObject("Chilkat.HttpResponse")
success = http.HttpStr("POST",url,json,"utf-8","application/json",resp)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
' Examine the HTTP request header we just sent.
Response.Write "<pre>" & Server.HTMLEncode( http.LastHeader) & "</pre>"
' Output:
' POST /echo_request_body.asp HTTP/1.1
' Host: chilkatsoft.com
' Accept: */*
' Accept-Encoding: gzip
' Content-Type: application/json
' Content-Length: 26
%>
</body>
</html>
|