本文整理汇总了C++中HttpHeader::del方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpHeader::del方法的具体用法?C++ HttpHeader::del怎么用?C++ HttpHeader::del使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpHeader
的用法示例。
在下文中一共展示了HttpHeader::del方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int
U_EXPORT main (int argc, char* argv[])
{
U_ULIB_INIT(argv);
U_TRACE(5,"main(%d)",argc)
UString value, path, domain, port, not_found;
HttpCookie c1(U_CONSTANT_TO_PARAM("Cookie"), U_CONSTANT_TO_PARAM("Name=value")),
c2(U_CONSTANT_TO_PARAM("Cookie"), U_CONSTANT_TO_PARAM(COOKIE_2)),
c5(U_CONSTANT_TO_PARAM("Cookie"), U_CONSTANT_TO_PARAM(COOKIE_5));
U_ASSERT( c5.find(U_STRING_FROM_CONSTANT("otptoken"), value, path, domain, port) == true )
U_ASSERT( value == U_STRING_FROM_CONSTANT("pluto") )
U_ASSERT( c1.count(U_STRING_FROM_CONSTANT("Name")) == 1 )
U_ASSERT( c2.count(U_STRING_FROM_CONSTANT("$Domain")) == 2 )
U_ASSERT( c1.find(U_STRING_FROM_CONSTANT("Name"), value, path, domain, port) == true )
U_ASSERT( value == U_STRING_FROM_CONSTANT("value") )
U_ASSERT( path == not_found )
U_ASSERT( domain == not_found )
U_ASSERT( port == not_found )
U_ASSERT( c2.find(U_STRING_FROM_CONSTANT("NameB"), value, path, domain, port) == true )
U_ASSERT( value == U_STRING_FROM_CONSTANT("ValueB") )
U_ASSERT( domain == U_STRING_FROM_CONSTANT("domain1") )
U_ASSERT( port == not_found )
#ifdef SERGIO
U_ASSERT( path == U_STRING_FROM_CONSTANT("/") )
#else
U_ASSERT( path == U_STRING_FROM_CONSTANT("\"/\"") )
#endif
U_ASSERT( c2.del(U_STRING_FROM_CONSTANT("NameB")) == true )
value = path = domain = port = not_found;
U_ASSERT( c2.find(U_STRING_FROM_CONSTANT("Name"), value, path, domain, port) == false )
U_ASSERT( value == not_found )
U_ASSERT( path == not_found )
U_ASSERT( domain == not_found )
U_ASSERT( port == not_found )
U_ASSERT( c2.find(U_STRING_FROM_CONSTANT("NameC"), value, path, domain, port) == true )
U_ASSERT( value == U_STRING_FROM_CONSTANT("ValueC") )
U_ASSERT( path == U_STRING_FROM_CONSTANT("domain1") )
#ifdef SERGIO
U_ASSERT( port == U_STRING_FROM_CONSTANT("123") )
U_ASSERT( domain == U_STRING_FROM_CONSTANT("/") )
#else
U_ASSERT( port == U_STRING_FROM_CONSTANT("\"123\"") )
U_ASSERT( domain == U_STRING_FROM_CONSTANT("\"/\"") )
#endif
HttpSetCookie s1(U_CONSTANT_TO_PARAM("Set-Cookie"), U_CONSTANT_TO_PARAM(SETCOOKIE_1)),
s2(U_CONSTANT_TO_PARAM("Set-Cookie2"), U_CONSTANT_TO_PARAM(SETCOOKIE_2));
U_ASSERT( s1.count(U_STRING_FROM_CONSTANT("Domain")) == 2 )
U_ASSERT( s2.count(U_STRING_FROM_CONSTANT("Port")) == 1 )
HttpCookie c3(U_CONSTANT_TO_PARAM("Cookie"), U_CONSTANT_TO_PARAM(COOKIE_AUTH) );
U_ASSERT( c3.count(U_STRING_FROM_CONSTANT("AUTHTOKEN")) == 1 )
value = path = domain = port = not_found;
U_ASSERT( c3.find(U_STRING_FROM_CONSTANT("AUTHTOKEN"), value, path, domain, port) == true )
U_ASSERT( path == not_found )
U_ASSERT( domain == not_found )
U_ASSERT( port == not_found )
value.erase(value.size()-1, 1);
value.erase(0, 1);
#ifdef U_PROXY_UNIT
DES3engine eng("pippo");
OtpAuthToken a(&eng, value);
#else
u_des3_key("pippo");
OtpAuthToken a(0, value);
#endif
U_ASSERT( a.tid == U_STRING_FROM_CONSTANT("Current_Server_ID") )
U_ASSERT( a.uid == U_STRING_FROM_CONSTANT("User_ID") )
U_ASSERT( a.sid == U_STRING_FROM_CONSTANT("Session_ID") )
U_ASSERT( a.ts == U_STRING_FROM_CONSTANT("20031125131800") )
U_ASSERT( a.cf == U_STRING_FROM_CONSTANT("codicefiscale1") )
U_ASSERT( a.migrate == true )
HttpHeader h;
HttpField* f = new HttpField(U_STRING_FROM_CONSTANT("Content-Type"), U_STRING_FROM_CONSTANT(" application/x-www-form-urlencoded"));
HttpBaAuthorization* ba = new HttpBaAuthorization(U_CONSTANT_TO_PARAM("Authorization"),
U_CONSTANT_TO_PARAM(" Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="));
HttpBaAuthorization* ba1 = new HttpBaAuthorization(U_CONSTANT_TO_PARAM("Authorization"),
U_CONSTANT_TO_PARAM(" Basic dXRlbnRlMTpzaWQx"));
//.........这里部分代码省略.........