Hi all,
I am trying to send some parameters to server using HTTP POST, i m using the code from WebClient example of SDK the code is as follows
The problem is on server what i find , the parameters are empty, meaning is parameters are not getting submitted, can anybody suggest what is wrong in above code ?Code:// Get request method string for HTTP GET RStringF method = iSession.StringPool().StringF( HTTP::EPOST, RHTTPSession::GetTable()); // 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 and accepted content type RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection(); SetHeaderL( hdr, HTTP::EUserAgent, KUserAgent ); SetHeaderL( hdr, HTTP::EAccept, KAccept ); SetHeaderL(hdr, HTTP::EContentType,KPostContentType ); SetHeaderL(hdr,HTTP::EContentEncoding,KContentTypeForm); // Submit the transaction. After this the framework will give transaction // events via MHFRunL and MHFRunError. TBuf8<30> userId; _LIT8(KUser,"vishal"); userId = KUser; TBuf8<20> param1; _LIT8(KParam1,"user_id"); param1 = KParam1; this->iFormEncoder->AddFieldL(param1,userId); iTransaction.Request().SetBody(*iFormEncoder); iTransaction.SubmitL(); iRunning = ETrue;
Thanks
Vishal



