(Chilkat2-Python) Example: Http.GetLastJsonData method
Demonstrates the GetLastJsonData method. Note: This example requires Chilkat v11.0.0 or greater.
import sys
import chilkat2
success = False
http = chilkat2.Http()
resp = chilkat2.HttpResponse()
# Only allow TLS 1.2 or better.
http.SslProtocol = "TLS 1.2 or higher"
success = http.HttpNoBody("GET","https://google.com/",resp)
if (success == False):
print(http.LastErrorText)
sys.exit()
json = chilkat2.JsonObject()
json.EmitCompact = False
http.GetLastJsonData(json)
print(json.Emit())
# Output as of Chilkat v11.1.0
# Additional information may be added as requested or needed in future versions of Chilkat.
# {
# "tls": {
# "params": {
# "sniHostname": "www.google.com",
# "allowConnectionOnlyIfServerChooses": "TLS 1.2 or higher"
# },
# "negotiatedTlsVersion": "TLS 1.3"
# }
# }
|