| 212 | |
| 213 | |
| 214 | void cURLManager::setHttpHeader(const std::vector<std::string>& lines) { |
| 215 | if (httpHeader) { |
| 216 | curl_slist_free_all(httpHeader); |
| 217 | httpHeader = NULL; |
| 218 | } |
| 219 | |
| 220 | for (size_t i = 0; i < lines.size(); ++i) { |
| 221 | debugf(3, "adding header line: '%s'\n", lines[i].c_str()); |
| 222 | httpHeader = curl_slist_append(httpHeader, lines[i].c_str()); |
| 223 | } |
| 224 | |
| 225 | CURLcode result; |
| 226 | result = curl_easy_setopt(easyHandle, CURLOPT_HTTPHEADER, httpHeader); |
| 227 | if (result != CURLE_OK) { |
| 228 | debugf(1, "CURLOPT_HTTPHEADER error %d : %s\n", result, errorBuffer); |
| 229 | } |
| 230 | |
| 231 | } |
| 232 | |
| 233 | |
| 234 | void cURLManager::setPostMode(const std::string& _postData) { |
nothing calls this directly
no test coverage detected