Reputation: 9696
So here is the class I need to cache the entire header map. So I figured I should extract it some how.
How can i do this, do i need to iterate them like this, or can I get them all at once?
I intend to store the header map in a cache like :
LRUPersistentCache<string, pair<HeaderMap, string > > *clientCache;
Upvotes: 0
Views: 763
Reputation: 5320
You can create NameValueCollection (it's a map-like HTTPResponse's parent) from HTTPResponse:
HTTPResponse response;
// ...
NameValueCollection nvc(response);
LRUPersistentCache<string, NameValueCollection> clientCache(100);
clientCache.add("myresponse", nvc);
// ...
Upvotes: 1