Article View: borland.public.cppbuilder.nativeapi
Article #4356Problems with HttpSendRequestEx
From: Bogdan
Date: Mon, 20 Feb 2006 18:36
Date: Mon, 20 Feb 2006 18:36
34 lines
2095 bytes
2095 bytes
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);
}
Technical Details
Message-ID:
<43fa0b42@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,aefec83386b1746e,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Bogdan" <boprea@xnet.ro> From: "Bogdan" <boprea@xnet.ro> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Problems with HttpSendRequestEx Date: Mon, 20 Feb 2006 20:36:44 +0200 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 85.186.237.190 Message-ID: <43fa0b42@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1140460354 85.186.237.190 (20 Feb 2006 10:32:34 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail