Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WinHttpOpenRequest, ERROR (by server) 404 FILE NOT FOUND

39 views
Skip to first unread message

ygef...@gmail.com

unread,
Jun 27, 2014, 10:23:53 AM6/27/14
to
Hello,

I'm programming a web Service in C++ and WinHttp. I'm trying to send text file to a IIS Server. But the http response is 404 NOT Found. Are there a special folder for the text file?

This is my code lines:

hRequest = WinHttpOpenRequest(hConnect, L"POST", L"HelloTest1.txt", NULL, L"D:\\Projet_WebService/WebSerciceClient/WebServiceClient/", WINHTTP_DEFAULT_ACCEPT_TYPES, NULL);

bResults = WinHttpSendRequest(hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, &in_pwchData, wcslen(in_pwchData)*sizeof(*in_pwchData), wcslen(in_pwchData)*sizeof(*in_pwchData), 0);

or:

hRequest = WinHttpOpenRequest(hConnect, L"POST", L"HelloTest1.txt", NULL, L"D:\\Projet_WebService/WebSerciceClient/WebServiceClient/", WINHTTP_DEFAULT_ACCEPT_TYPES, NULL);

bResults = WinHttpSendRequest(hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0);

bResults = WinHttpWriteData( hRequest, in_pwchData, wcslen(in_pwchData), &dwBytesWritten);

PS: GetLastError(), doesn't return error. I'v got just ERROR from communcation ERROR 404 NOT FOUND. And my server reveives correctly the demand "PUT" "/HelloTest1.txt".

Thnak for your help
0 new messages