Send Request to Web Service and get Statuscode
Hi @ all,
i want to send a request to a web service with standard vc++ not .NET.
The Url of request looks like this:
http//www.mypage.de/index.apsx?param1=x¶m2=y
Now I want to send this parameters to the WebService. Which method i have to use to do this?
I´ve tried it with CInternetSession.OpenURL but I think that is the wrong method.
I need a method which gives me the status code back. i.e. 200 OK or 404 Not Found.
Best regards
Crazy
Re: Send Request to Web Service and get Statuscode
Quote:
Originally Posted by
CrazyPlaya
Now I want to send this parameters to the WebService. Which method i have to use to do this?
I´ve tried it with CInternetSession.OpenURL but I think that is the wrong method.
After you create an instance of CInternetSession, call CInternetSession::GetHttpConnection() to establish HTTP connection and get a pointer to a CHttpConnection object that can manage the connection to the server.
Regards
Doron Moraz
EDIT: If the call to GetHttpConnection() fails, you can determine the cause of the failure by examining the thrown CInternetException object.