Exemple #1
0
void UrlSerializer::AddString(const char* key, CStdString& value)
{
	CStdString pair;
	CStdString escapedValue;
	EscapeUrl(value, escapedValue);
	pair.Format("%s=%s&", key, (PCSTR)escapedValue);
	m_output += pair;
}
BOOL CPushPlayerInfoHttpCMD::Init()
{
    
    CHAR szUrl[1024] = {0};
    EscapeFields();
    EscapeUrl(szUrl, sizeof(szUrl) - 1);

    curl_easy_setopt(m_pEasyHandle, CURLOPT_URL, szUrl);
    curl_easy_setopt(m_pEasyHandle, CURLOPT_ERRORBUFFER, m_szErrorBuff);
    curl_easy_setopt(m_pEasyHandle, CURLOPT_WRITEDATA, this);
    curl_easy_setopt(m_pEasyHandle, CURLOPT_POST, 1 );
    curl_easy_setopt(m_pEasyHandle, CURLOPT_POSTFIELDS, m_strfields.c_str());
    return TRUE;
}