0

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?

theWalker
  • 2,022
  • 2
  • 18
  • 27

1 Answers1

1

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.

kiewic
  • 15,852
  • 13
  • 78
  • 101