C++ 从winhttp标头检索多个cookie

C++ 从winhttp标头检索多个cookie,c++,winhttp,C++,Winhttp,我想从winhttpheader检索Cookie。问题是header的格式如下: Header-Contents Transfer-Encoding: chunked Server: nginx Set-Cookie: name=xyz; Path=/ ; secure; httponly Set-Cookie: token=45e8e18440859e769a56b0e1191bea8f1cc049d1; Path=/ ; secure; httponly 现在使用winhttp\u que

我想从winhttpheader检索Cookie。问题是header的格式如下:

Header-Contents
Transfer-Encoding: chunked
Server: nginx
Set-Cookie: name=xyz; Path=/
; secure; httponly
Set-Cookie: token=45e8e18440859e769a56b0e1191bea8f1cc049d1; Path=/
; secure; httponly
现在使用winhttp\u query\u set\u cookie,我只得到名称字段,而不是令牌

  do
   {
           bQuerySizeResult=WinHttpQueryHeaders(hRequest,WINHTTP_QUERY_SET_COOKIE,WINHTTP_HEADER_NAME_BY_INDEX,NULL,&nCookie,WINHTTP_NO_HEADER_INDEX);
        WCHAR *strCookie=new WCHAR[nCookie];
         LPCTSTR ws1;
              bQuerySizeResult=WinHttpQueryHeaders(hRequest,WINHTTP_QUERY_SET_COOKIE,WINHTTP_HEADER_NAME_BY_INDEX,strCookie,&nCookie,WINHTTP_NO_HEADER_INDEX);

        std::wcout<<"\n" <<strCookie[0]<<" "<<strCookie[1];
        ws1=strCookie;
        std::wstring  ws(ws1);
        std::string str(ws.begin(), ws.end());
        LPSTR mystring ;
        mystring= const_cast<LPSTR>(str.c_str());
      std::cout<<"\nthe str is "<<mystring<<"\n";
}while(bQuerySizeResult);*/
do
{
bQuerySizerResult=WinHttpQueryHeaders(hRequest、WINHTTP\u查询\u集\u COOKIE、WINHTTP\u头\u名称\u按索引、NULL和nCookie、WINHTTP\u否\u头\u索引);
WCHAR*strCookie=新的WCHAR[nCookie];
lpctstrws1;
bQuerySizerResult=WinHttpQueryHeaders(hRequest、WINHTTP\u查询\u集\u COOKIE、WINHTTP\u头\u名称\u按索引、strCookie和nCookie、WINHTTP\u否头\u索引);

std::wcoutdo{bQuerySizerResult=WinHttpQueryHeaders(hRequest、WINHTTP_查询集_COOKIE、WINHTTP_头_名称_BY_INDEX、NULL、&nCookie、WINHTTP_NO_头_INDEX);WCHAR*strCookie=new WCHAR[nCookie];LPCTSTR ws1;bQrySizerResult=WinHttpQueryHeaders(HREQUERS、WINHTTP_查询集_COOKIE、WINHTTP_头_名称_BY_索引、strCookie、strCookie、WINHTTP_头_头_索引);std::wcoutin代替注释编辑代码并粘贴它。