void  WRTHttpRequest::send(WRTHttpResponse* response)
{
	_response = response;
	std::wstring sURL;
	Uri^ uri;	
	switch (getRequestType())
    {
        case WRTHttpRequest::kHttpGet:	// HTTP GET
		{			
			sURL=stringToWstring(_url.c_str(),sURL);
			String^ tUrl= ref new String(sURL.c_str());					
			convertURL(tUrl,&uri);				
            GetAsync(uri);
		}
            break;            
        case WRTHttpRequest::kHttpPost: // HTTP POST
		{
			sURL=stringToWstring(_url.c_str(),sURL);
			String^ tUrl= ref new String(sURL.c_str());					
			convertURL(tUrl,&uri);
			std::wstring content;
			content=stringToWstring(_requestData.data(),content);
            PostAsync(uri,content);
		}
            break;

        case WRTHttpRequest::kHttpPut:
                
            break;

        case WRTHttpRequest::kHttpDelete:
                
            break;            
        default:
            CCAssert(true, "CCHttpClient: unkown request type, only GET and POSt are supported");
            break;
    }                
}
void KNetworkProtocol::operationListChildren(QNetworkOperation* op)
{
    KURL kurl = convertURL(url());

    KIO::Job* job = KIO::listDir(kurl, !m_isLocalFS);
    if (job == 0)
    {
        op->setState(StFailed);
        emit finished(op);
        return;
    }

    m_operations.insert(job, op);
    connectJob(job);

    op->setState(StInProgress);
    emit start(op);
}
void KNetworkProtocol::operationRemove(QNetworkOperation* op)
{
    KURL kurl = convertURL(url());
    kurl = KURL(kurl.prettyURL() + "/" + op->arg(0));

    KIO::Job* job = KIO::del(kurl);
    if (job == 0)
    {
        op->setState(StFailed);
        emit finished(op);
        return;
    }

    m_operations.insert(job, op);
    connectJob(job);

    op->setState(StInProgress);
    emit start(op);
}