CkPython
CkPython
Example: Http.QuickGetSb method
Demonstrates theQuickGetSb method.
Chilkat CkPython Downloads
import sys
import chilkat
success = False
http = chilkat.CkHttp()
# Send the HTTP GET and return the content in a StringBuilder
sb = chilkat.CkStringBuilder()
success = http.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json",sb)
if (http.get_LastMethodSuccess() == False):
if (http.get_LastStatus() == 0):
# Communications error. We did not get a response.
print(http.lastErrorText())
else:
print("Response status code: " + str(http.get_LastStatus()))
print("Response body error text:")
print(sb.getAsString())
sys.exit()
# The downloaded content:
print(sb.getAsString())
print("Success")