| 9 | #include <iostream> |
| 10 | |
| 11 | void httpcon(const std::string& url, bool useHttp1_0 = false) { |
| 12 | Exiv2::Dictionary response; |
| 13 | Exiv2::Dictionary request; |
| 14 | std::string errors; |
| 15 | |
| 16 | Exiv2::Uri uri = Exiv2::Uri::Parse(url); |
| 17 | Exiv2::Uri::Decode(uri); |
| 18 | |
| 19 | request["server"] = uri.Host; |
| 20 | request["page"] = uri.Path; |
| 21 | request["port"] = uri.Port; |
| 22 | if (!useHttp1_0) |
| 23 | request["version"] = "1.1"; |
| 24 | |
| 25 | int serverCode = Exiv2::http(request, response, errors); |
| 26 | if (serverCode < 0 || serverCode >= 400 || !errors.empty()) { |
| 27 | throw Exiv2::Error(Exiv2::ErrorCode::kerTiffDirectoryTooLarge, "Server", serverCode); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | #ifdef EXV_USE_CURL |
| 32 | void curlcon(const std::string& url, bool useHttp1_0 = false) { |