本文整理汇总了C++中HTTPRequest::addPOSTValue方法的典型用法代码示例。如果您正苦于以下问题:C++ HTTPRequest::addPOSTValue方法的具体用法?C++ HTTPRequest::addPOSTValue怎么用?C++ HTTPRequest::addPOSTValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPRequest
的用法示例。
在下文中一共展示了HTTPRequest::addPOSTValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trackEvent
void StartupCall::trackEvent(const char *eventName)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
const char *platform = "win";
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
const char *platform = "mac";
#else
const char *platform = "UNKNOWN";
#endif
HTTPRequest *request = HTTPRequest::createWithUrl(NULL,
"http://www.google-analytics.com/collect",
kCCHTTPRequestMethodPOST);
request->addPOSTValue("v", "1");
request->addPOSTValue("tid", "UA-84326395-1");
request->addPOSTValue("cid", Native::getOpenUDID().c_str());
request->addPOSTValue("t", "event");
request->addPOSTValue("an", "player");
request->addPOSTValue("av", cocos2dVersion());
request->addPOSTValue("ec", platform);
request->addPOSTValue("ea", eventName);
request->start();
}
示例2:
static int tolua_cocos2dx_extra_luabinding_HTTPRequest_addPOSTValue00(lua_State* tolua_S)
{
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"HTTPRequest",0,&tolua_err) ||
!tolua_isstring(tolua_S,2,0,&tolua_err) ||
!tolua_isstring(tolua_S,3,0,&tolua_err) ||
!tolua_isnoobj(tolua_S,4,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
HTTPRequest* self = (HTTPRequest*) tolua_tousertype(tolua_S,1,0);
const char* key = ((const char*) tolua_tostring(tolua_S,2,0));
const char* value = ((const char*) tolua_tostring(tolua_S,3,0));
#if COCOS2D_DEBUG >= 1
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addPOSTValue'", NULL);
#endif
{
self->addPOSTValue(key,value);
}
}
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'addPOSTValue'.",&tolua_err);
return 0;
#endif
}