Not all servers support all of the listed commands, and some
commands may require specific changes to the server configuration. In
particular, the PUT and DELETE commands typically require that
configuration changes be made by the site administrator. All servers
will support the use of the GET command, and all servers that support
at least version 1.0 of the protocol will support the POST
command.
If the lpszResource parameter specifies a path that
contains reserved or restricted characters, such as a space, it will
automatically be URL encoded by the library.
It is permissible to include a query string in the resource name
specified by the lpszResource parameter. Query strings begin
with a question mark, and then are followed by one or more name/value
pairs separated by an equal sign. For example, the following resource
includes a query string:
/cgi-bin/test.cgi?field1=value1&field2=value2
In this case, the query string is
"?field1=value1&field2=value2". If the query string
contains reserved or restricted characters, such as spaces, then it
will be automatically URL encoded prior to being sent to the server.
If additional resource data is specified in the lpParameter
argument along with a query string in the resource name, the action
taken by the library depends on the command being sent. If the
command is a POST or PUT command, then query string is included with
command request to the server and the parameter data is sent
separately. For example, if the POST command was used, the script
running on the server would see that both query data and form data
has been provided to it. However, if any other command is specified,
the parameter data is simply appended to the query string.
The lpParameter argument is used to pass additional
information to the server when a resource is requested. This is most
commonly used to provide information to scripts, similar to how
arguments are used when executing a program from the command line.
Unless the POST command is being executed, the data in the buffer
will automatically be encoded using the current encoding mechanism
specified for the client. By default, the data is URL encoded, which
means that any spaces and non-printable characters are converted to
printable characters before submitted to the server. The type of
encoding that is performed can be set by calling the
HttpSetEncodingType function. Although the default encoding is
appropriate for most applications, those that submit XML formatted
data may need to change the encoding type.
Only one request may be in progress at one time for each client
session. Use the HttpCloseFile function to terminate the
request after all of the data has been read from the server.