Please help cause I really stuck with this thing..
I want to send HTTP post, I have compiled symbian HTTP example for N80 (S60 3rd edition)
I am running this function and get error -36 (disconnected).
Can anyone say what is wrong with the code or have working example sending HTPT post request.
I think that functions like CWebClientEngine::MHFRunL are implemented correctly because my codes are working when sending GET request.
void CWebClientEngine::IssueHTTPPostL(const TDesC8& aUri,
const TDesC8& aContentType,
const TDesC8& aBody)
// Parse string to URI
// Copy data to be posted into member variable; iPostData is used later in
// methods inherited from MHTTPDataSupplier.
iPostData = aBody.AllocL();
// Get request method string for HTTP POST
RStringF method = iSession.StringPool().StringF(HTTP::EPOST,
// Open transaction with previous method and parsed uri. This class will
// receive transaction events in MHFRunL and MHFRunError.
iTransaction = iSession.OpenTransactionL(uri, *this, method);
// Set headers for request; user agent, accepted content type and body's
// content type.
RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
SetHeaderL(hdr, HTTP::EAccept, KAccept);
SetHeaderL(hdr, HTTP::EContentType, aContentType);
// Set this class as an data supplier. Inherited MHTTPDataSupplier methods
// are called when framework needs to send body data.
[B] // this is just what I have changed cause before I was getting
// error -7334 (empty body)[/B]
iRunning = ETrue;
TBool CWebClientEngine::GetNextDataPart(TPtrC8& aDataPart)
// 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.