symbian 使用http get post方式获取网页信息
2010-05-31 19:38:00 来源:WEB开发网核心提示:provides data for HTTP post. // TBool CClientEngine::GetNextDataPart(TPtrC8& aDataPart) { if(iPostData) { // Provide pointer to next chunk of data (return ETru
provides data for HTTP post. //
----------------------------------------------------------------------------
TBool CClientEngine::GetNextDataPart(TPtrC8& aDataPart) { if(iPostData) { //
Provide pointer to next chunk of data (return ETrue, if last chunk) // Usually
only one chunk is needed, but sending big file could require // loading the file
in small parts. aDataPart.Set(iPostData- >Des()); } return ETrue; } //
---------------------------------------------------------------------------- //
CClientEngine::ReleaseData() // // Inherited from MHTTPDataSupplier // Called by
framework. Allows us to release resources needed for previous // chunk. (e.g.
free buffers) //
----------------------------------------------------------------------------
void CClientEngine::ReleaseData() { // It's safe to delete iPostData now. delete
iPostData; iPostData = NULL; } //
---------------------------------------------------------------------------- //
CClientEngine::Reset() // // Inherited from MHTTPDataSupplier // Called by
framework to reset the data supplier. Indicates to the data // supplier that it
should return to the first part of the data. // In practise an error has occured
while sending data, and framework needs to // resend data. //
----------------------------------------------------------------------------
TInt CClientEngine::Reset() { // Nothing needed since iPostData still exists and
contains all the data. // (If a file is used and read in small parts we should
seek to beginning // of file and provide the first chunk again in
GetNextDataPart() ) return KErrNone; } //
---------------------------------------------------------------------------- //
CClientEngine::OverallDataSize() // // Inherited from MHTTPDataSupplier //
Called by framework. We should return the expected size of data to be sent. //
If it's not know we can return KErrNotFound (it's allowed and does not cause //
problems, since HTTP protocol allows multipart bodys without exact content //
更多精彩
赞助商链接