yhirose/cpp-httplib

Client: Access all headers sent from server

martinwede opened this issue · 1 comments

Is there any way to get all HTTP headers sent by the server for a client request?
I need to interface a custom HTTP server which sends nonstandard headers and I need to parse these headers.
I do not know in advance which headers are sent or what the keys are so I would like to get access to all headers of a response.

Example:

httplib::Client cli(url);
auto res = cli.Post("/register", json, "application/json");
if (res)
{
     if (res->status == 200)
     {
            <iterate through all headers sent from server, print key and value>
     }
}

You can access headers via res->headers;