Question

When I use pwszObjectName with full net path:

WinHttpOpenRequest(hConnect, L"POST", L"http:\\.......

this function send to server not "http:\\..." but "\http:\\..." with leading slash.

How can I delete this first slash?

Was it helpful?

Solution

You must write just the path to the file, i.e.

WinHttpOpenRequest(hConnect, L"POST", L"/path/to/myFile.html", ...

Or if you are requesting the main page use just an slash:

WinHttpOpenRequest(hConnect, L"POST", L"/", ...

This function does not accept full urls.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top