Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 08:29, 14 November 2007.

TSS000203 - Using the HTTP Client API with RConnection

From Forum Nokia Wiki

Subject Using the HTTP Client API with RConnection TSS000203
Platform(s) S60 2nd Edition
Series 80 2nd Edition
Category Symbian C++
Subcategory Networking
Description If you use the HTTP Client API, there are no chances to specify connection preferences. The default preference is to show the IAP selection dialog. However, it is more user-friendly that the IAP is selected only once by the user. The solution is to create a connection using RConnection, where you can define connection preferences as you like. Then you can attach a HTTP session to the connection as shown before.
---
User::LeaveIfError(iSocketServ.Connect());
User::LeaveIfError(iConnection.Open(iSocketServ));
iHttpSession.OpenL();
 
// Initiate connection
iConnection.Start(iStatus);
 
//...
 
RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo();
RStringPool pool = iHttpSession.StringPool();
 
// Attach to socket server
connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal(iSocketServ.Handle()));
 
// Attach to connection<br>TInt connPtr = REINTERPRET_CAST(TInt, &iConnection);
connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(connPtr));
 
// Open transaction...
iHttpTrans = iHttpSession.OpenTransactionL(iUri, *this, pool.StringF(HTTP::EGET, RHTTPSession::GetTable()));
RHTTPHeaders hdr = iHttpTrans.Request().GetHeaderCollection();
 
//...
Creation date April 7, 2005
Last modified -
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX