Tcl
Tcl
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat Tcl Downloads
load ./chilkat.dll
set http [new_CkHttp]
# Keep the response body if there's an error.
CkHttp_put_KeepResponseBody $http 1
# Send the HTTP GET and return the content in a string.
set str [CkHttp_quickGetStr $http "https://www.chilkatsoft.com/helloWorld.json"]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
if {[CkHttp_get_LastStatus $http] == 0} then {
# Communications error. We did not get a response.
puts [CkHttp_lastErrorText $http]
} else {
puts "Response status code: [CkHttp_get_LastStatus $http]"
puts "Response body error text:"
puts [CkHttp_lastResponseBody $http]
}
delete_CkHttp $http
exit
}
puts "$str"
puts "Success"
delete_CkHttp $http