| 223 | |
| 224 | |
| 225 | std::string encodeUrl(const std::string& s) { |
| 226 | CURL* curl = createCurl(); |
| 227 | DEFER({curl_easy_cleanup(curl);}); |
| 228 | assert(curl); |
| 229 | char* escaped = curl_easy_escape(curl, s.c_str(), s.size()); |
| 230 | DEFER({curl_free(escaped);}); |
| 231 | return std::string(escaped); |
| 232 | } |
| 233 | |
| 234 | |
| 235 | std::string urlPath(const std::string& url) { |
no test coverage detected