MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / httpcon

Function httpcon

samples/conntest.cpp:11–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <iostream>
10
11void 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
32void curlcon(const std::string& url, bool useHttp1_0 = false) {

Callers 1

mainFunction · 0.85

Calls 2

ErrorFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected