Sample code
This is how looks a piece of code for requesting a web page from a HTTPS Server:
HTTPSConnection *cnn = new HTTPSConnection(40960, 10240); //Buffer for the connection
HTTPRequest *req = new HTTPRequest(cnn);
responseCode = req->execute(httpGet, “www.yahoo.com”, NULL);
if (req->getLastError()) {
if (req->getLastError() == errCantResolveHost)
content = "Cannot Resolve Host";
else
content = "Error: URL can't be retrieve.";
}
else {
content = req->getResponse()->getContent(); //HTML code
contentL = req->getResponse()->getContentLength(); //page length
}
//Release Objects
delete req;
delete cnn;
and here is a screenshot of a simple application (included in the package):
This library was designed for compiling with Metrowerks CodeWarrior. Contact us for using it with other development tools