Using libevent to do HTTP request. I would like to print all the HTTP headers in the server response, but not sure how.
static void http_request_done(struct evhttp_request *req, void *ctx) {
//how do I print out all the http headers in the server response
}
evhttp_request_new(http_request_done,NULL);
I know I can get an individual header like the following, but how do I get all the headers?
static void http_request_done(struct evhttp_request *req, void *ctx) {
struct evkeyvalq * kv = evhttp_request_get_input_headers(req);
printf("%s\n", evhttp_find_header(kv, "SetCookie"));
}
Thanks.