Add buffer size to HttpClientSession

This commit is contained in:
Chunting Gu
2019-03-19 12:27:25 +08:00
parent bc586c3ea0
commit 53fb2a92c9
10 changed files with 92 additions and 55 deletions
+3 -5
View File
@@ -55,7 +55,7 @@ void ExampleWrappers() {
{"Accept", "application/json"},
HttpRequestArgs{}.buffer_size(1000));
session.Post("http://httpbin.org/post", "{ 'key': 'value' }", true,
session.Post("http://httpbin.org/post", "{'key': 'value'}", true,
{"Accept", "application/json"});
}
@@ -94,7 +94,7 @@ void ExampleKeepAlive(const std::string& url) {
// Close
session.Request(webcc::HttpRequestArgs("GET").url(url).
ssl_verify(kSslVerify).
headers({ "Connection", "Close" }));
headers({"Connection", "Close"}));
// Keep-Alive
session.Request(webcc::HttpRequestArgs("GET").url(url).
@@ -114,11 +114,9 @@ void ExampleCompression() {
int main() {
WEBCC_LOG_INIT("", LOG_CONSOLE);
// Note that the exception handling is mandatory.
try {
// ExampleBasic();
ExampleCompression();
ExampleBasic();
} catch (const Exception& e) {
std::cout << "Exception: " << e.what() << std::endl;