David Karlsson
David Karlsson

Reputation: 9696

Poco C++ HTTPResponse how can i get the entire header map of a response?

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

Answers (1)

Alex
Alex

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

Related Questions