WEB开发网
开发学院手机开发Symbian 开发 symbian 使用http get post方式获取网页信息 阅读

symbian 使用http get post方式获取网页信息

 2010-05-31 19:38:00 来源:WEB开发网   
核心提示:CClientEngine::~CClientEngine() // // Destructor. // CClientEngine::~CClientEngine() { iSession.Close(); // and finally close handles iConnection.Close(); iSoc
CClientEngine::~CClientEngine() // // Destructor. // ---------------------------------------------------------------------------- CClientEngine::~CClientEngine() { iSession.Close(); // and finally close handles iConnection.Close(); iSocketServ.Close(); delete iPostData; } // ---------------------------------------------------------------------------- // CClientEngine::ConstructL() // // Second phase construction. // ---------------------------------------------------------------------------- void CClientEngine::ConstructL() { // Open RHTTPSession with default protocol ("HTTP/TCP") TRAPD(err, iSession.OpenL()); if(err != KErrNone) { // Most common error; no access point configured, and session creation // leaves with KErrNotFound. _LIT(KErrMsg, "Cannot create session. Is internet access point configured?"); _LIT(KExitingApp, "Exiting app."); CEikonEnv::Static()- >InfoWinL(KErrMsg, KExitingApp); User::Leave(err); } // Install this class as the callback for authentication requests. When // page requires authentication the framework calls GetCredentialsL to get // user name and password. InstallAuthenticationL(iSession); } // ---------------------------------------------------------------------------- // CClientEngine::SetHeaderL() // // Used to set header value to HTTP request // ---------------------------------------------------------------------------- void CClientEngine::SetHeaderL(RHTTPHeaders aHeaders,//设置一个http包头 TInt aHdrField, const TDesC8& aHdrValue) { RStringF valStr = iSession.StringPool().OpenFStringL(aHdrValue); CleanupClosePushL(valStr); THTTPHdrVal val(valStr); aHeaders.SetFieldL(iSession.StringPool().StringF(aHdrField, RHTTPSession::GetTable()), val); CleanupStack::PopAndDestroy(); // valStr } // ---------------------------------------------------------------------------- // CClientEngine::IssueHTTPGetL() // // Start a new HTTP GET transaction. // ----------------------------------------------------------------------------

上一页  11 12 13 14 15 16 17 18 19 20 21  下一页

Tags:symbian 使用 http

编辑录入:coldstar [复制链接] [打 印]
赞助商链接