summaryrefslogtreecommitdiffstats
path: root/src/HTTP/UrlClient.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2023-05-09 19:59:15 +0200
committerMattes D <github@xoft.cz>2023-05-19 16:25:12 +0200
commit97c49c6f294a0b7e931be2692c124bd78fc79946 (patch)
tree872fcdfbfc30ff0ed2e2e444bb965769ea147e60 /src/HTTP/UrlClient.h
parentcTCPLink: Use the original connection hostname for SNI. (diff)
downloadcuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.tar
cuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.tar.gz
cuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.tar.bz2
cuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.tar.lz
cuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.tar.xz
cuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.tar.zst
cuberite-97c49c6f294a0b7e931be2692c124bd78fc79946.zip
Diffstat (limited to '')
-rw-r--r--src/HTTP/UrlClient.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/HTTP/UrlClient.h b/src/HTTP/UrlClient.h
index aaff60a87..a73f22521 100644
--- a/src/HTTP/UrlClient.h
+++ b/src/HTTP/UrlClient.h
@@ -9,6 +9,7 @@ Options that can be set via the Options parameter to the cUrlClient calls:
"OwnCert": The client certificate to use, if requested by the server. Any string that can be parsed by cX509Cert.
"OwnPrivKey": The private key appropriate for OwnCert. Any string that can be parsed by cCryptoKey.
"OwnPrivKeyPassword": The password for OwnPrivKey. If not present or empty, no password is assumed.
+"TrustedRootCAs": The trusted root CA certificates (\n-delimited concatenated PEM format) to be used for peer cert verification. If not present, peer cert is not verified.
Behavior:
- If a redirect is received, and redirection is allowed, the redirection is reported via OnRedirecting() callback
@@ -116,16 +117,16 @@ public:
cCallbacksPtr && a_Callbacks,
AStringMap && a_Headers,
const AString & a_Body,
- AStringMap && a_Options
+ const AStringMap & a_Options
);
/** Alias for Request("GET", ...) */
static std::pair<bool, AString> Get(
const AString & a_URL,
cCallbacksPtr && a_Callbacks,
- AStringMap && a_Headers = AStringMap(),
- const AString & a_Body = AString(),
- AStringMap && a_Options = AStringMap()
+ AStringMap && a_Headers = {},
+ const AString & a_Body = {},
+ const AStringMap & a_Options = {}
);
/** Alias for Request("POST", ...) */
@@ -134,7 +135,7 @@ public:
cCallbacksPtr && a_Callbacks,
AStringMap && a_Headers,
const AString & a_Body,
- AStringMap && a_Options
+ const AStringMap & a_Options = {}
);
/** Alias for Request("PUT", ...) */
@@ -143,7 +144,7 @@ public:
cCallbacksPtr && a_Callbacks,
AStringMap && a_Headers,
const AString & a_Body,
- AStringMap && a_Options
+ const AStringMap & a_Options = {}
);
/** The method will run a thread blocking HTTP request. Any error handling
@@ -153,17 +154,17 @@ public:
static std::pair<bool, AString> BlockingRequest(
const AString & a_Method,
const AString & a_URL,
- AStringMap && a_Headers = AStringMap(),
- const AString & a_Body = AString(),
- AStringMap && a_Options = AStringMap()
+ AStringMap && a_Headers = {},
+ const AString & a_Body = {},
+ const AStringMap & a_Options = {}
);
/** Alias for BlockingRequest("GET", ...) */
static std::pair<bool, AString> BlockingGet(
const AString & a_URL,
- AStringMap a_Headers = AStringMap(),
- const AString & a_Body = AString(),
- AStringMap a_Options = AStringMap()
+ AStringMap a_Headers = {},
+ const AString & a_Body = {},
+ const AStringMap & a_Options = {}
);
/** Alias for BlockingRequest("POST", ...) */
@@ -171,7 +172,7 @@ public:
const AString & a_URL,
AStringMap && a_Headers,
const AString & a_Body,
- AStringMap && a_Options
+ const AStringMap & a_Options = {}
);
/** Alias for BlockingRequest("PUT", ...) */
@@ -179,7 +180,7 @@ public:
const AString & a_URL,
AStringMap && a_Headers,
const AString & a_Body,
- AStringMap && a_Options
+ const AStringMap & a_Options = {}
);
};