Question

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;
Was it helpful?

Solution

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);
// ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top