【问题标题】:Poco C++ HTTPResponse how can i get the entire header map of a response?Poco C++ HTTPResponse 如何获取响应的整个标头映射?
【发布时间】:2013-04-25 09:04:30
【问题描述】:

所以这里是class 我需要缓存整个标题映射。所以我想我应该如何提取它。

我该怎么做,我需要像 this 那样迭代它们,还是我可以一次得到它们?

我打算将标头映射存储在缓存中,例如:

       LRUPersistentCache<string, pair<HeaderMap, string > > *clientCache;

【问题讨论】:

    标签: c++ poco-libraries


    【解决方案1】:

    您可以从 HTTPResponse 创建 NameValueCollection(它是一个类似于地图的 HTTPResponse 的父级):

    HTTPResponse response;
    // ...
    NameValueCollection nvc(response);
    LRUPersistentCache<string, NameValueCollection> clientCache(100);
    clientCache.add("myresponse", nvc);
    // ...
    

    【讨论】:

      猜你喜欢
      • 2013-04-06
      • 1970-01-01
      • 2013-06-19
      • 2016-09-21
      • 2013-03-01
      • 1970-01-01
      • 2011-09-19
      • 1970-01-01
      • 2018-08-08
      相关资源
      最近更新 更多