My C++ application consists of posting out through an HTTP connection directly to the Weblogic App server. Need to change it to post using HTTPS.
*Im running this application through Visual Studio. *
Any kind of suggestions are welcome. Coding updates are most helpful
The below is the code i have for HTTP connectivity works fine.
What i need to do it to work with HTTPS?
strFormData = sFile;
strHeaders = _T("Content-Type: application/x-www-form-urlencoded");
CInternetSession session;
CHttpConnection* pConnection = session.GetHttpConnection(_T(Server), Port);
CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T(Action));
result = pFile->SendRequest(strHeaders,(LPVOID)(LPCTSTR)strFormData,
Data.GetLength());
The Hypertext Transfer Protocol (HTTP) is a stateless application layer protocol for distributed, collaborative, hypermedia information systems. In this article, I will explain, how you can create an HTTP get post request in C without using the library.
An HTTP response is made by a server to a client. The aim of the response is to provide the client with the resource it requested, or inform the client that the action it requested has been carried out; or else to inform the client that an error occurred in processing its request.
CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T(Action), NULL, 1, NULL, NULL, INTERNET_FLAG_SECURE);
I tried this code and it worked out for HTTPS posting. I found that parametric values (Internet secure flag) varies with HTTP & HTTPS posting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With