Board index » cppbuilder » Problems with HttpSendRequestEx
Bogdan
![]() CBuilder Developer |
Problems with HttpSendRequestEx2006-02-21 02:36:44 AM cppbuilder71 I'm trying to use HttpSendRequestEx to make assynchronious http requests, but all i'm getting is 0 bytes.If i use HttpSendRequest it works fine, but i cannot make it asynchroniuos, so it blocks my thread. Internet = InternetOpen("App",INTERNET_OPEN_TYPE_PRECONFIG,NULL, NULL,/*INTERNET_FLAG_ASYNC*/0); Connection = InternetConnect(Internet,server,INTERNET_INVALID_PORT_NUMBER, NULL,NULL,INTERNET_SERVICE_HTTP,0,NULL); if(Connection) { Request = HttpOpenRequest(Connection,"GET",script,NULL,HTTP_VERSION,NULL, INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE, NULL); if(Request) { DWORD Size = 0; DWORD Read = 0; DWORD Total = 0; result = HttpSendRequestEx(Request,NULL,NULL,HSR_DOWNLOAD,0); /*result = HttpSendRequest(Request,NULL,0,NULL,0);*/ InternetQueryDataAvailable(Request,&Read,0,0); printf("%d\n",Read); InternetCloseHandle(Request); } InternetCloseHandle(Connection); } |