문제

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;
도움이 되었습니까?

해결책

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);
// ...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top