We just moved from WinINET to WinHTTP. The latter does not have an equivalent InternetCanonicalizeUrl
The WinHTTP docs say that WinHTTPOpenRequest
does this automatically but there is nothing there that specifically addresses this.
According to this reference
you can use WinHTTPCreateURL
which uses a URL_COMPONENTS
structure to define the various URL parts. In the latter the lpszExtraInfo
property is where you put the ?param=xyz& ... part.
Here is my problem - one of the parameters in the paramter string needs to be canonicalized as it could contain non-URL friendly characters (Example &).
With the WinINET version we used InternetCanonicalizeUrl
on the specific URL parts which were then appended to the URL string.
If we have a URL now that looks like this
mydomain.com?param='Name & Surname','Description'
And we pass that to WinHTTPOpenRequest - it does not know that the & in Name & Surname is data and not a parameter separator.
How do we canonicalize individual parameters in the URL with WinHTTP