| 21 | } |
| 22 | |
| 23 | bool HttpFetcher::Fetch(wchar_t const * path, std::vector<uint8_t> & response) |
| 24 | { |
| 25 | auto request = WinHttpOpenRequest(httpSession_, L"GET", path, NULL, |
| 26 | WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE); |
| 27 | if (request == NULL) return false; |
| 28 | |
| 29 | bool result = false; |
| 30 | if (SendRequest(request, path)) { |
| 31 | result = FetchBody(request, response); |
| 32 | } |
| 33 | |
| 34 | WinHttpCloseHandle(request); |
| 35 | return result; |
| 36 | } |
| 37 | |
| 38 | bool HttpFetcher::FetchETag(wchar_t const * path, std::string & etag) |
| 39 | { |