Identifier: http_code

Type

numeric

Description

The execution status code of the last http request sent over the internet.

The value of this identifier gets set during execution of the commands httpget (aka download) and httppost, and when requests are sent to a database or channel internet service. If one of these actions failed before an http request was sent, the value of http_code is set to 0, implying that no internet request was even attempted.

This value is read-only and cannot be set directly.

Code values may be in the range 200 through 505 for an HTTP protocol error, or in the range 12001 through 12156 for a Microsoft WinInet error. Typically HTTP protocol codes are set when an http request has been processed from the destination web server, and WinInet codes are set when some other error occurred during the transport phase.

Error Codes

Although many of the following codes will never apply, the full list is provided for reference purposes.

HTTP Protocol Code

Meaning

100 Continue
101 Switching Protocols
200 OK (no error)
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
304 Not Modified
305 Use Proxy
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Time-Out
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URL Too Large
415 Unsupported Media Type
500 Server Error
501 Not Implemented
502 Bad Gateway
503 Out of Resources
504 Gateway Time-Out
505 HTTP Version not supported

WinInet Error Code

Meaning

12001 No more handles could be generated at this time.
12002 The request has timed out.
12003 An extended error was returned from the server. This is typically a string or buffer containing a verbose error message.
12004 An internal error has occurred.
12005 The URL is invalid.
12006 The URL scheme could not be recognized or is not supported.
12007 The server name could not be resolved.
12008 The requested protocol could not be located.
12009 A request to InternetQueryOption or InternetSetOption specified an invalid option value.
12010 The length of an option supplied to InternetQueryOption or InternetSetOption is incorrect for the type of option specified.
12011 The request option cannot be set, only queried.
12012 The Win32 Internet function support is being shut down or unloaded.
12013 The request to connect and log on to an FTP server could not be completed because the supplied user name is incorrect.
12014 The request to connect and log on to an FTP server could not be completed because the supplied password is incorrect.
12015 The request to connect to and log on to an FTP server failed.
12016 The requested operation is invalid.
12017 The operation was canceled, usually because the handle on which the request was operating was closed before the operation completed.
12018 The type of handle supplied is incorrect for this operation.
12019 The requested operation cannot be carried out because the handle supplied is not in the correct state.
12020 The request cannot be made via a proxy.
12021 A required registry value could not be located.
12022 A required registry value was located but is an incorrect type or has an invalid value.
12023 Direct network access cannot be made at this time.
12024 An asynchronous request could not be made because a zero context value was supplied.
12025 An asynchronous request could not be made because a callback function has not been set.
12026 The required operation could not be completed because one or more requests are pending.
12027 The format of the request is invalid.
12028 The requested item could not be located.
12029 The attempt to connect to the server failed.
12030 The connection with the server has been terminated.
12031 The connection with the server has been reset.
12032 Calls for the Win32 Internet function to redo the request.
12033 The request to the proxy was invalid.
12036 The request failed because the handle already exists.
12037 SSL certificate date that was received from the server is bad. The certificate is expired.
12038 SSL certificate common name (host name field) is incorrect.
12039 The application is moving from a non-SSL to an SSL connection because of a redirect.
12040 The application is moving from an SSL to an non-SSL connection because of a redirect.
12041 Indicates that the content is not entirely secure. Some of the content being viewed may have come from unsecured servers.
12042 The application is posting and attempting to change multiple lines of text on a server that is not secure.
12043 The application is posting data to a server that is not secure.
12110 The requested operation cannot be made on the FTP session handle because an operation is already in progress.
12111 The FTP operation was not completed because the session was aborted.
12130 An error was detected while parsing data returned from the gopher server.
12131 The request must be made for a file locator.
12132 An error was detected while receiving data from the gopher server.
12133 The end of the data has been reached.
12134 The supplied locator is not valid.
12135 The type of the locator is not correct for this operation.
12136 The requested operation can only be made against a Gopher+ server or with a locator that specifies a Gopher+ operation.
12137 The requested attribute could not be located.
12138 The locator type is unknown.
12150 The requested header could not be located.
12151 The server did not return any headers.
12152 The server response could not be parsed.
12153 The supplied header is invalid.
12154 The request made to HttpQueryInfo is invalid.
12155 The header could not be added because it already exists.
12156 The redirection failed because either the scheme changed (for example, HTTP to FTP) or all attempts made to redirect failed (default is five attempts).

See Also

Commands:

channel, database, httpget, httppost