Classic ASP
Classic ASP
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set http = Server.CreateObject("Chilkat.Http")
' Keep the response body if there's an error.
http.KeepResponseBody = 1
' Send the HTTP GET and return the content in a string.
str = http.QuickGetStr("https://www.chilkatsoft.com/helloWorld.json")
If (http.LastMethodSuccess = 0) Then
If (http.LastStatus = 0) Then
' Communications error. We did not get a response.
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Else
Response.Write "<pre>" & Server.HTMLEncode( "Response status code: " & http.LastStatus) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Response body error text:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( http.LastResponseBody) & "</pre>"
End If
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( str) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Success") & "</pre>"
%>
</body>
</html>