| 279 | } |
| 280 | |
| 281 | void CurlHttpRequest::SetPostEmptyBody() { |
| 282 | CheckNotSent(); |
| 283 | CheckMethodNotSet(); |
| 284 | is_method_set_ = true; |
| 285 | method_ = RequestMethod::kPost; |
| 286 | CHECK_CURL_OK(libcurl_->curl_easy_setopt(curl_, CURLOPT_POST, 1)); |
| 287 | AddHeader("Content-Length", "0"); |
| 288 | AddHeader("Transfer-Encoding", "identity"); |
| 289 | CHECK_CURL_OK(libcurl_->curl_easy_setopt(curl_, CURLOPT_READDATA, |
| 290 | reinterpret_cast<void*>(this))); |
| 291 | CHECK_CURL_OK(libcurl_->curl_easy_setopt(curl_, CURLOPT_READFUNCTION, |
| 292 | &CurlHttpRequest::ReadCallback)); |
| 293 | } |
| 294 | |
| 295 | void CurlHttpRequest::SetResultBuffer(std::vector<char>* out_buffer) { |
| 296 | CheckNotSent(); |