problem with Http connection using POST | developer.brewmp.com problem with Http connection using POST | developer.brewmp.com

Developer

problem with Http connection using POST

Forums:

Hi,

I am try establish a http connection using a POST.

This is the code:

if(pMe->piEnv == NULL){
	return -1;

if(AEE_SUCCESS != (nErr = IEnv_CreateInstance(pMe->piEnv, AEECLSID_Web, (void **)&pMe->m_pWeb))){
	return -1;


CALLBACK_Init(&pMe->m_NetworkCB, HttpConnectCB, pMe);
if (pMe->m_pWebResp) {
	IWebResp_Release(pMe->m_pWebResp);
	pMe->m_pWebResp = NULL;


nErr = ISHELL_CreateInstance(pMe->piShell, AEECLSID_SOURCEUTIL, (void **)&pMe->pISourceUtil);
if(AEE_SUCCESS != nErr){
	return -1;


ISOURCEUTIL_SourceFromMemory(pMe->pISourceUtil,ucHttpBufferTx, 
		ulHttpBufferTxLength, NULL, NULL,&(pMe->pISource));
ISOURCEUTIL_Release(pMe->pISourceUtil);

pMe->m_dwContentLength = .ulHttpBufferTxLength;
SPRINTF(scontentLength, "x-Method: POST\r\nContent-Type: application/octet-stream\r\nAccept: */*\r\nContent-Length: %d\r\n", pMe->m_dwContentLength );
	
getHttpURL(pMe->m_pszWebURL);

IWeb_GetResponse(pMe->stHttp.m_pWeb, 
		&pMe->stHttp.m_pWebResp, 
		&pMe->stHttp.m_NetworkCB, 
		pMe->stHttp.m_pszWebURL, 
		WEBOPT_HANDLERDATA, pMe, 
		WEBOPT_HEADERHANDLER, HttpHeader, 
		WEBOPT_STATUSHANDLER, HttpStatus, 
		WEBOPT_HEADER, scontentLength, 
		WEBOPT_METHOD, "POST", 
		WEBOPT_CONTENTLENGTH, pMe->m_dwContentLength, 
		WEBOPT_BODY, (void*)pMe->pISource, 
		WEBOPT_END);

But in the server I received a GET:

     

 

What is the problem?

 

Server result are not visible, As far as you are providing WEBOPT_METHOD,"POST" there shoun't be any issue.
There is an sample application (netdiagnostic) shipped with BREW SDK, you may want to take reference of this application and will help you narrow down the issue.

Server result are not visible, As far as you are providing WEBOPT_METHOD,"POST" there shoun't be any issue.
There is an sample application (netdiagnostic) shipped with BREW SDK, you may want to take reference of this application and will help you narrow down the issue.

 
I added the option of the connection using Iweb_addopt as it indicates by the link and now it works correctly.
 
Now, I'm trying to make a https connection, but I have doubts on how to load the certificates. I have the certificate, the certificate authority and the private key.
 
The certificate is loaded with WEB_X509_ROOT_CERT, but the certificate authority and private key, How could I load it? 

 
I added the option of the connection using Iweb_addopt as it indicates by the link and now it works correctly.
 
Now, I'm trying to make a https connection, but I have doubts on how to load the certificates. I have the certificate, the certificate authority and the private key.
 
The certificate is loaded with WEB_X509_ROOT_CERT, but the certificate authority and private key, How could I load it? 

I had this link,  but it doesn't appear as load the certificate authority and the private key only appears the certificate.

I had this link,  but it doesn't appear as load the certificate authority and the private key only appears the certificate.