PowerShell
PowerShell
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$http = New-Object Chilkat.Http
# Keep the response body if there's an error.
$http.KeepResponseBody = $true
# Send the HTTP GET and return the content in a string.
$str = $http.QuickGetStr("https://www.chilkatsoft.com/helloWorld.json")
if ($http.LastMethodSuccess -eq $false) {
if ($http.LastStatus -eq 0) {
# Communications error. We did not get a response.
$($http.LastErrorText)
}
else {
$("Response status code: " + $http.LastStatus)
$("Response body error text:")
$($http.LastResponseBody)
}
exit
}
$($str)
$("Success")