| |
| INT GetClientHeader( |
| |
UINT nClientId, |
|
| |
UINT nHeaderType, |
|
| |
LPCTSTR lpszHeaderName, |
|
| |
LPTSTR lpszHeaderValue, |
|
| |
INT nMaxLength, |
|
| ); |
Return the value of a request or response header for the
specified client session.
Parameters
- nClientId
- An unsigned integer which uniquely identifies the client
session.
- nHeaderType
- Specifies the type of header. It may be one of the
following values:
| Constant |
Description |
| HTTP_HEADERS_REQUEST |
Return the value of a request header that was provided by the client.
Request header values provide additional information to
the server about the type of request being made. |
| HTTP_HEADERS_RESPONSE |
Return the value of a response header that was created by the server.
Response header
values provide additional information to the client about the
type of information that is being returned by the server. |
- lpszHeaderName
- A pointer to a string that specifies the name of
the header field. Header names are not
case-sensitive and should not include the colon which acts as a
delimiter that separates the header name from its value. This
parameter cannot be a NULL pointer or an empty string.
- lpszHeaderValue
- A pointer to a buffer that will contain the header value,
terminated with a null character. To determine the length of the
header value, this parameter can be NULL and the nMaxLength
parameter should be specified with a value of zero.
- nMaxLength
- An integer that specifies the maximum number of characters that
can be copied into the header value buffer, including the
terminating null character. If the lpszHeaderValue parameter
is NULL, this value must be zero.
Return Value
If the method succeeds, the return value is the length of
the header value, not including the terminating null character. If the
client ID does not specify a valid client session, or there is no
header that matches the given name, the method will return zero.
If the lpszHeaderValue parameter is not NULL and the buffer
is not large enough to store the complete header value, the method
will return zero and the last error code will be set to
ST_ERROR_BUFFER_TOO_SMALL. If the method fails, the GetLastError
method will return more information about the last error that has
occurred.
Remarks
The GetClientHeader method will return the value of a request or
response header for the specified client session. If the
lpszHeaderName value matches an existing header field, its value
will be copied to the string buffer provided by the caller.
Refer to Hypertext Transfer Protocol
Headers for a list of common request and response headers that are
used.
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: cshtsv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
DeleteClientHeader,
GetAllClientHeaders,
SetClientHeader
|
|