bool UPPayHttpConnection::openConnection() { RStringF method = iSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable()); if (!iIsGetMethod) { method = iSession.StringPool().StringF(HTTP::EPOST, RHTTPSession::GetTable()); } #ifdef F_ENCODE_URI iTransaction = iSession.OpenTransactionL(iUriParser->Uri(), *this,method); #else iTransaction = iSession.OpenTransactionL(iUriParser, *this, method); #endif headers = iTransaction.Request().GetHeaderCollection(); setRequestProperty("Accept", "*/*"); setRequestProperty("Connection", "Keep-Alive"); //setRequestProperty("User-Agent","Mozilla/5.0 (SymbianOS/9.1;U;[en];NokiaN73-1/3.0638.0.0.1 Series60/3.0) AppleWebKit/413 (KHTML, like Gecko) Safari/413"); //#endif if (iContentStartPos != 0) { TBuf8<100> range; range.Append(_L8("bytes=")); range.AppendNum(iContentStartPos); range.Append(_L8("-\0\0")); char* temp = new char[range.Length() + 1]; memset(temp, 0, range.Length() + 1); memcpy(temp, range.Ptr(), range.Length()); setRequestProperty("RANGE", (const char *) temp); //CommonUtils::WriteLogL(_L8("RANGE:"), range); delete temp; } return true; }
IppURLConnection::IppURLConnection(const URL &Url) : HttpURLConnection(Url) { __ippRequest = NULL; __ippResponse = new IppContent; setRequestMethod("POST"); setRequestProperty("Content-Type", "application/ipp"); setRequestProperty("Cache-Control", "no-cache"); setRequestProperty("Pragma", "no-cache"); }
void IppURLConnection::setRequest() { if (connected) { char buf[64]; itoa(__ippRequest->length(), buf, 10); setRequestProperty("Content-Length", buf); HttpURLConnection::setRequest(); } }