| 199 | } |
| 200 | |
| 201 | struct curl_slist *HTTPClient::build_header_list(std::string regex, const std::map<std::string, std::string> &attributes) { |
| 202 | if (http_session_) { |
| 203 | for (auto attribute : attributes) { |
| 204 | if (matches(attribute.first, regex)) { |
| 205 | std::string attr = attribute.first + ":" + attribute.second; |
| 206 | headers_ = curl_slist_append(headers_, attr.c_str()); |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | return headers_; |
| 211 | } |
| 212 | |
| 213 | void HTTPClient::setContentType(std::string content_type) { |
| 214 | content_type_ = "Content-Type: " + content_type; |