【发布时间】:2013-04-25 09:04:30
【问题描述】:
所以这里是class 我需要缓存整个标题映射。所以我想我应该如何提取它。
我该怎么做,我需要像 this 那样迭代它们,还是我可以一次得到它们?
我打算将标头映射存储在缓存中,例如:
LRUPersistentCache<string, pair<HeaderMap, string > > *clientCache;
【问题讨论】:
标签: c++ poco-libraries
所以这里是class 我需要缓存整个标题映射。所以我想我应该如何提取它。
我该怎么做,我需要像 this 那样迭代它们,还是我可以一次得到它们?
我打算将标头映射存储在缓存中,例如:
LRUPersistentCache<string, pair<HeaderMap, string > > *clientCache;
【问题讨论】:
标签: c++ poco-libraries
您可以从 HTTPResponse 创建 NameValueCollection(它是一个类似于地图的 HTTPResponse 的父级):
HTTPResponse response;
// ...
NameValueCollection nvc(response);
LRUPersistentCache<string, NameValueCollection> clientCache(100);
clientCache.add("myresponse", nvc);
// ...
【讨论】: