Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wininet and cgi ...

Status
Not open for further replies.

iza

Programmer
Apr 4, 2000
1,804
FR
hi :)
i'm sure it's an obvious question, and it sure has already been answered but the search feature is disabled ;)
so ...
i'm using the wininet classes to send a request, and retrieve the result sent by the server. It works fine until i change the server settings to post to a cgi page ... then my app says it times out :(

some code if it helps ...
this works :
CInternetSession sess(_T("..."));
CHttpConnection* connexion=sess.GetHttpConnection("fr.....net",(INTERNET_PORT)8080,NULL,NULL);
if (connexion!=NULL) {
CHttpFile* hFile=connexion->OpenRequest(
"POST",
"foo1/foo2",
"....net",
1,
NULL,
NULL,
INTERNET_FLAG_EXISTING_CONNECT);
if (hFile)
{
char szBoundary[] = "...";
if ((hFile->AddRequestHeaders("Content-Type: multipart/form-data; boundary=...", HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE)))
{
//put all form datas in pbuffer
//...
if ((hFile->SendRequest(NULL, 0, (LPVOID)pBuffer,nBufferOffset)))
...
}

ok, this is fine. Now i replace the green line with this one and it's not working anymore !!!!

CHttpFile* hFile=connexion->OpenRequest(
"POST",
"cgi-bin/foo1/foo2.cgi",
...);

what am i missing there ?????

 
iza,

A point to keep in mind is that your request is going to the web server. Your request and the wininet libraries do not know or care about the CGI script. The web server handles the CGI script. Therefore the problem is not related to Wininet.

-pete
 
thanx - that's what i was thinking, but it's kinda hard to debug, as i can't have an access to the server :(
 
> thanx - that's what i was thinking, but it's kinda hard to debug, as
> i can't have an access to the server :(

If it is not your script, why do you need to debug it? If it is your script why don't you have access to it?

Confused
-pete
 
i mean, the script has been written by someone in my company, and the server belongs to my company as well - but 1. i can't access them (script & server) easily and 2. i know they are *not* bugged, so it had to be my app !! and it was the file i was sending, i was missing a carriage return ... !!!! now it's working almost fine, i'm just looking for differences between win9x and win2000 for the release (such as : it seems CClientDC are not exactly supported the same way ..)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top