Article View: borland.public.cppbuilder.nativeapi
Article #4362Re: Problems with HttpSendRequestEx
From: Remy Lebeau (TeamB)
Date: Tue, 21 Feb 2006 09:03
Date: Tue, 21 Feb 2006 09:03
28 lines
2041 bytes
2041 bytes
"Bogdan" <boprea@xnet.ro> wrote in message news:43fa0b42@newsgroups.borland.com... > If i use HttpSendRequest it works fine, but I cannot make > it asynchroniuos, so it blocks my thread. Your thread is being blocked anyway because your code is processing the connection synchronously regardless of the flags you set. InternetQueryDataAvailable() is a blocking function. > Request = > HttpOpenRequest(Connection, "GET", script, NULL, > HTTP_VERSION, NULL, INTERNET_FLAG_RELOAD | > INTERNET_FLAG_NO_CACHE_WRITE, NULL); You have the lpszVersion and lpszReferer parameters reversed, and you are passing NULL for the lpszAcceptTypes parameter. That last part in particular is important. By passing NULL, you are telling the server that your client cannot accept anything at all. At the very least, you should be specifying "*/*". > result = HttpSendRequestEx(Request,NULL,NULL,HSR_DOWNLOAD,0); The dwFlags parameter is reserved. It must be set to 0, not HSR_DOWNLOAD. Gambit
Technical Details
Message-ID:
<43fad647$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43fa0b42@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,aefec83386b1746e X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <43fa0b42@newsgroups.borland.com> Subject: Re: Problems with HttpSendRequestEx Date: Tue, 21 Feb 2006 01:03:31 -0800 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <43fad647$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1140512327 68.69.17.41 (21 Feb 2006 00:58:47 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail