well... you can use the inet.lib which provides the apis or use the lower
level lib net.lib.
when using inet.lib you can do it like:
err = SysLibFind("INet.lib", &libRefNum);
//check if its is already installed
if (err == sysErrLibNotFound)
{
//it is not, we have to do it ourself
err = DmGetNextDatabaseByTypeCreator (true, &stateInfo, NULL, NULL,
false, &cardNoP, &dbIDP);
while (err == 0)
{
DmDatabaseInfo (cardNoP, dbIDP, nameP, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, &typeP, &creatorP);
if (!StrCompare (nameP, "INet Library"))
{
SysLibLoad (typeP, creatorP, &libRefNum);
loadedLib = true;
break;
}
err = DmGetNextDatabaseByTypeCreator (false, &stateInfo, NULL, NULL,
false, &cardNoP, &dbIDP);
}
if (err != 0)
{
SysCopyStringResource (rcStr, ID_LOGIN_NOLIBSTR);
FrmCustomAlert (ID_APP_ERRORALERT, "No inet.lib was found", "", "");
return;
}
}
//We are now sure that the inetlib is loaded and we know its reference
//stored in libRefNum. We can go on with inititializing the http request
INetLibConfigIndexFromName (libRefNum,
(INetConfigNameType*)inetCfgNameDefault,
&configIndex);
err = INetLibOpen (libRefNum, configIndex, NULL, NULL, NULL, &inetHP);
err = INetLibSockOpen (libRefNum, inetHP, inetSchemeHTTP, &sockHP);
err = INetLibSockHTTPReqCreate (libRefNum, sockHP, "POST",
http://www.myserver.de/bla.oxp, NULL);
err = INetLibSockHTTPReqSend (libRefNum, sockHP, Request,
StrLen (Request), 100);
//waiting for http data in an eventloop
//
do
{
INetLibGetEvent (libRefNum, inetHP, &event, 100);
if (event.data.inetSockStatusChange.sockErr != 0)
{
sprintf (Request, "eventtype: %d Sockerr: %d", event.eType,
event.data.inetSockStatusChange.sockErr);
FrmCustomAlert (ID_APP_CONFIRMALERT, "Sockerr, exit", Request, "");
err = INetLibClose (libRefNum, inetHP);
if (loadedLib)
SysLibRemove (libRefNum);
return;
}
if (ReceiveHTTPReqAppHandleEvent (&event, libRefNum, sockHP))
break;
} while (event.eType != appStopEvent);
err = INetLibClose (libRefNum, inetHP);
thats it :) dont think you will get along with the source, but you can look
up the functions easily at
http://www.palmos.com/dev/support/docs/palmos/INetLib.html#1363988
good luck.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/