本文整理汇总了C++中HttpHeader::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpHeader::clear方法的具体用法?C++ HttpHeader::clear怎么用?C++ HttpHeader::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpHeader
的用法示例。
在下文中一共展示了HttpHeader::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
h.add(ba1);
HttpOtpPostLogin p(U_CONSTANT_TO_PARAM(POST_BODY), U_STRING_FROM_CONSTANT("user"),
U_STRING_FROM_CONSTANT("pin"),
U_STRING_FROM_CONSTANT("token"),
U_STRING_FROM_CONSTANT("password"),
U_STRING_FROM_CONSTANT("cf"), h);
U_ASSERT( p.user == U_STRING_FROM_CONSTANT("stefano casazza") )
U_ASSERT( p.pin == U_STRING_FROM_CONSTANT("12345") )
U_ASSERT( p.token == U_STRING_FROM_CONSTANT("autorizzativo") )
HttpField* p1 = h.del(U_STRING_FROM_CONSTANT("Content-Type"));
U_ASSERT( p1 != 0 )
U_ASSERT( p1 == f )
HttpBaAuthorization* p2 = (HttpBaAuthorization*) h.find(U_STRING_FROM_CONSTANT("Authorization"));
U_ASSERT( p2 != 0 )
U_ASSERT( p2 == ba )
U_ASSERT( p2->user == U_STRING_FROM_CONSTANT("Aladdin") )
U_ASSERT( p2->passwd == U_STRING_FROM_CONSTANT("open sesame") )
HttpBaAuthorization* p3 = (HttpBaAuthorization*) h.find(U_STRING_FROM_CONSTANT("Authorization"), 1);
U_ASSERT( p3 != 0 )
U_ASSERT( p3 == ba1 )
U_ASSERT( p3->user == U_STRING_FROM_CONSTANT("utente1") )
U_ASSERT( p3->passwd == U_STRING_FROM_CONSTANT("sid1") )
h.clear();
UString result;
a.stringify(result);
// TID=trustACCESS1;UID=utente1;SID=;TS=20031201174127;CF=codicefiscale1
# define COOKIE_AUTH_1 \
"U2FsdGVkX1/QsrBvmsVHx0rrX78ldh6IJu1+4GhKoJ9O5ETSbfSiDip1gszkZX7w5ah6vkYfRWI8271LcNKhUsZVehRoscudLO8uotQgeiiF1B46ITphGw=="
// TID=trustACCESS1;UID=utente1;SID=sid;TS=20031201174127;CF=codicefiscale1;HP1=Profile_Header1;HPn=Profile_Headern;MIGRATE
# define COOKIE_AUTH_2 \
"U2FsdGVkX1+tUkpPi14NVlKhm5KUFbSH0JFvi23+8B75MnKgtyD/sc0hc0ESmSahiYozVbS6a3OoZfWDHX3G3zuUwCP7n1+3jXK0wu6niifYUW+cKBk1WUdpJZd0xjJernDsWtPfq9j30uatAhHULG57vdrKlbtxM/EIaiaUow1AeLuDiZDcTRonghpI/aaz"
#ifdef U_PROXY_UNIT
DES3engine eng1("password");
OtpAuthToken c(&eng1, U_STRING_FROM_CONSTANT(COOKIE_AUTH_2));
DES3engine eng2("password");
OtpAuthToken b(&eng2, U_STRING_FROM_CONSTANT(COOKIE_AUTH_1));
#else
u_des3_key("password");
OtpAuthToken c(0, U_STRING_FROM_CONSTANT(COOKIE_AUTH_2));
u_des3_reset();
OtpAuthToken b(0, U_STRING_FROM_CONSTANT(COOKIE_AUTH_1));
#endif
U_ASSERT( b.is_valid() == false )
U_ASSERT( c.is_valid() == true )
U_ASSERT( c.tid == U_STRING_FROM_CONSTANT("trustACCESS1") )
U_ASSERT( c.uid == U_STRING_FROM_CONSTANT("utente1") )
U_ASSERT( c.sid == U_STRING_FROM_CONSTANT("sid") )
U_ASSERT( c.ts == U_STRING_FROM_CONSTANT("20031201174127") )