HTTP.GetHTTPErrorInfo

table HTTP.GetHTTPErrorInfo (

)

Example 1

ErrInfo = HTTP.GetHTTPErrorInfo();

Gets the last HTTP error info and stores it in table ErrInfo.

Example 2

HTTP.Download("http://www.asitehere.com/file.ext", "c:\\file.ext",MODE_BINARY, 20, 80, nil, nil, nil);

if (Application.GetLastError()~= 0) then
-- An Error Occurred
HTTP_Error = HTTP.GetHTTPErrorInfo();
Dialog.Message("HTTP error " .. HTTP_Error.Number, HTTP_Error.Message);
end

Downloads a file. If the returned error is anything other than successful, display the extended HTTP error information.

Example 3

HTTP.Download("http://www.asitehere.com/file.ext", "c:\\file.ext",MODE_BINARY, 20, 80, nil, nil, nil);

local http_error = HTTP.GetHTTPErrorInfo();

if (http_error.Status < 200 or http_error.Status > 299) then

-- Show two dialogs containing the HTTP error info
Dialog.Message("Error Info", "HTTP Download Error Info: " .. http_error.Number .. " - " .. http_error.Message);
Dialog.Message("Error Info", "HTTP Download Server Status: " .. http_error.Status);
end

Downloads a file. If the server status indicates that an error occurred, shows a couple of dialog messages.

See also: Related Actions