智慧屏安装APP的最佳实践与跨平台小程序开发的结合
727
2022-10-30
Cookie字符串转Map集合方法
需求:将Cookie字符串解析为Map集合
1、首先构造一个Cookie字符串
private static String COOKIE = "traceid=ca4c9c8b50; _ga=GA1.2.704388932.1617513691; _gid=GA1.2.85700497.1617513691; _qpsvr_localtk=0.2810983015733952; RK=uCLoGvbeXG; ptcz=f997dfbd9d785b321bb377710933cae37308f34abb4b2340706eda53e23455cc; pgv_pvid=4861902100; pgv_info=ssid=s7567138318; ptui_loginuin=327844761; qqmusic_uin=0327844761; qqmusic_fromtag=6; qqmusic_key=@R3lRxCHCr; p_uin=o0327844761; _gat_gtag_UA_172919674_1=1; uin=o0327844761; skey=@APPCpl4ip; pt4_token=EWPb3WyZfLoQPIfmYfSjWDKOJXOIt09*xjIidJVdC54_; p_skey=6dlS-INlRzNbnEOA09*Zn2l6cfPMI4ardDbcWCwqsQI_";
2、编写Cookie字符串转map集合方法
public static Map
3、验证结果是否符合预期结果
{traceid=ca4c9c8b50, _qpsvr_localtk=0.2810983015733952, uin=o0327844761, _gid=GA1.2.85700497.1617513691, ptcz=f997dfbd9d785b321bb377710933cae37308f34abb4b2340706eda53e23455cc, _gat_gtag_UA_172919674_1=1, p_skey=6dlS-INlRzNbnEOA09*Zn2l6cfPMI4ardDbcWCwqsQI_, skey=@APPCpl4ip, pt4_token=EWPb3WyZfLoQPIfmYfSjWDKOJXOIt09*xjIidJVdC54_, pgv_info=ssid, _ga=GA1.2.704388932.1617513691, qqmusic_uin=0327844761, RK=uCLoGvbeXG, p_uin=o0327844761, qqmusic_fromtag=6, qqmusic_key=@R3lRxCHCr, ptui_loginuin=327844761, pgv_pvid=4861902100}
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~