This method returns the number of characters copied into the
string buffer, not including the terminating null character. If the
lpszNormalized parameter is NULL, it will return the length
of the normalized URL but will not copy any characters. If the
method fails, it will return HTTP_ERROR. To get extended error
information, call GetLastError.
This method will accept a standard HTTP or HTTPS URL and
return a canonical version of that URL. Normalization will remove
extraneous path delimiters and collapse the path if there are references
to parent directories. If non-standard port numbers are included in
the URL, they will be preserved. For example, if the following URL
is provided to the method:
https://www.example.com:443/file/..//project/filename.pdf
It will return the following as the normalized URL:
https://www.example.com/project/filename.pdf
Because the port number specified in the original URL is the
default port number for secure HTTP connections, it is removed.
In addition, the path is collapsed and the extraneous path
delimiters are removed.
This method is primarily intended to normalize URLs which may be
entered by a user or read from a configuration file. It is not
necessary to call this method prior to calling ConnectUrl
because it will always be normalized internally prior to the
connection being established. If you wish to check a URL to ensure it
is valid and the server name can be resolved to an IP address, use the
ValidateUrl method.
If you need to normalize a remote file path, use the
NormalizePath method.