Send request to open a http link
-
Hi, I want to send a request to execute a http link which is running in another machine.how to do this using?Is there any function in MFC or SDK? anyone please help me? thanks,
See CHttpConnection and the other classes that help you do this
-
Hi, I want to send a request to execute a http link which is running in another machine.how to do this using?Is there any function in MFC or SDK? anyone please help me? thanks,
What do you mean by "execute"?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
-
What do you mean by "execute"?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
I want to send a request to another system to run a URL.I tried with following code. Its showing error like URL is invalid. But im able to open that URL from my machine.But not able to open that URL using this code. CInternetSession objInetSession; CHttpConnection *objhttp ; CHttpFile *objFile; char szURL[100]; while(1) { objhttp = objInetSession.GetHttpConnection ("http:////101.16.0.42/test/prelogin.aspx", INTERNET_FLAG_MAKE_PERSISTENT, INTERNET_INVALID_PORT_NUMBER, NULL, NULL); try { wsprintf(szURL,"%s","http:////101.16.0.242/test/prelogin.aspx"); CStdioFile* objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII,NULL,0); } catch(CInternetException* exp) { exp->ReportError(MB_OK,0); } }
modified on Thursday, April 8, 2010 1:29 AM
-
I want to send a request to another system to run a URL.I tried with following code. Its showing error like URL is invalid. But im able to open that URL from my machine.But not able to open that URL using this code. CInternetSession objInetSession; CHttpConnection *objhttp ; CHttpFile *objFile; char szURL[100]; while(1) { objhttp = objInetSession.GetHttpConnection ("http:////101.16.0.42/test/prelogin.aspx", INTERNET_FLAG_MAKE_PERSISTENT, INTERNET_INVALID_PORT_NUMBER, NULL, NULL); try { wsprintf(szURL,"%s","http:////101.16.0.242/test/prelogin.aspx"); CStdioFile* objStdFile = objInetSession.OpenURL(szURL,1,INTERNET_FLAG_TRANSFER_ASCII,NULL,0); } catch(CInternetException* exp) { exp->ReportError(MB_OK,0); } }
modified on Thursday, April 8, 2010 1:29 AM
1. '/' is not an escape character so your url should be "http://101.16.0.42/..." not http:////... 2. Depending on what that the script at that url does, what you're trying to do might or might not work. Read about the HTTP protocolhere in very simple terms, when using a http connection, you're making a request (that might contain some parameters - see GET/POST methods) and you receive a response - the html code that you see in your browser I hope this helps :)
-
1. '/' is not an escape character so your url should be "http://101.16.0.42/..." not http:////... 2. Depending on what that the script at that url does, what you're trying to do might or might not work. Read about the HTTP protocolhere in very simple terms, when using a http connection, you're making a request (that might contain some parameters - see GET/POST methods) and you receive a response - the html code that you see in your browser I hope this helps :)