If the function succeeds, the return value is non-zero. If the
server handle is invalid or the command is not recognized, the function
will return zero. If the function fails, the HttpGetServerError
function will return more information about the last error that has
occurred.
The HttpEnableCommand function is used to enable or disable
access to a specific command on the server. This function is
typically used to enable or disable certain commands for security
purposes. For example, the PUT command can be disabled, preventing any
client from attempting to upload files directly to the server. The
HttpIsCommandEnabled function can be used to determine if a
command is enabled or not.
The command name provided to this function must match the commands
defined in RFC 2616 or related protocol standards. Refer to
Hypertext Transfer Protocol
Commands for a complete list of server commands.
Some commands cannot be disabled because they are required to
perform essential server functions. For example, the GET and HEAD
commands cannot be disabled. If you attempt to disable a required
command, this function will return zero and the last error code will
be set to ST_ERROR_COMMAND_REQUIRED. Because this function affects
all clients connected to the server, it should not be used to limit
access to certain commands for specific clients. Instead, use an
event handler to filter the commands.
The OPTIONS and TRACE commands are disabled by default for all
server instances and must be explicitly enabled using the
EnableCommand method if you wish permit clients to use them. It is
not recommended that you enable these commands if your server is going
to be publicly accessible over the Internet. If the server started
with the option HTTP_SERVER_READONLY, commands that can be used to
create or modify files on the server will be disabled by default.