std::string wim_packet::create_query_from_map(const Str2StrMap& _params) { std::stringstream ss_query; for (auto iter = _params.begin(); iter != _params.end(); iter++) { if (iter != _params.begin()) { ss_query << "&"; } ss_query << iter->first << "=" << iter->second; } return ss_query.str(); }
void RestTask::_handle(){ _timeStamp = time(NULL); --_retryCount; //handle(); Str2StrMap paras; paras["call_id"] = boost::lexical_cast<string>(time(NULL)); paras["v"] = "1.0"; paras["format"] = "xml"; Str2StrMap tmp = parameters(); paras.insert(tmp.begin(), tmp.end()); if(paras.find("api_key") == paras.end()){ paras["api_key"] = "ffa4add0b30141aa9eb9a8f1af34a8c3"; } paras["sig"] = makeSig(paras); if(paras.empty()){ return; } string path = "http://api.renren.com/server/restserver.do"; int userid = boost::lexical_cast<int>(paras["session_key"]); try{ RestMediatorAdapter::instance().restRequest(id(), userid, path, paras); }catch(Ice::Exception& e){ MCE_WARN("RestTask::handle-->RestMediatorAdapter::restRequest-->" << e); } }
void UserConfigDataI::setProperties(const Str2StrMap& properties) { Str2StrMap::const_iterator it; for (it = properties.begin(); it != properties.end(); ++it) { setProperty(it->first, it->second); } }
void RegionInfoHandle::setProperties(const Str2StrMap& properties) { Str2StrMap::const_iterator it; for (it = properties.begin(); it != properties.end(); ++it) { setProperty(it->first, it->second); } }