| 480 | } |
| 481 | |
| 482 | std::pair<bool, std::string> HTTPRequest::GetHeader(const std::string& hdr) |
| 483 | { |
| 484 | const struct evkeyvalq* headers = evhttp_request_get_input_headers(req); |
| 485 | assert(headers); |
| 486 | const char* val = evhttp_find_header(headers, hdr.c_str()); |
| 487 | if (val) |
| 488 | return std::make_pair(true, val); |
| 489 | else |
| 490 | return std::make_pair(false, ""); |
| 491 | } |
| 492 | |
| 493 | std::string HTTPRequest::ReadBody() |
| 494 | { |