Add zlib to support content-encoding (gzip, deflate)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
set(EXAMPLE_COMMON_LIBS webcc ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES}
|
||||
"${CMAKE_THREAD_LIBS_INIT}")
|
||||
if(WIN32)
|
||||
set(EXAMPLE_COMMON_LIBS ${EXAMPLE_COMMON_LIBS} crypt32)
|
||||
set(EXAMPLE_COMMON_LIBS ${EXAMPLE_COMMON_LIBS} zlibstatic crypt32)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
|
||||
+10
-1
@@ -16,6 +16,7 @@ bool kSslVerify = true;
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Examples
|
||||
|
||||
void ExampleBasic() {
|
||||
HttpClientSession session;
|
||||
@@ -100,7 +101,15 @@ void ExampleKeepAlive(const std::string& url) {
|
||||
ssl_verify(kSslVerify));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
void ExampleCompression() {
|
||||
HttpClientSession session;
|
||||
|
||||
auto r = session.Get("http://httpbin.org/gzip");
|
||||
std::cout << r->content() << std::endl;
|
||||
|
||||
r = session.Get("http://httpbin.org/deflate");
|
||||
std::cout << r->content() << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
WEBCC_LOG_INIT("", LOG_CONSOLE);
|
||||
|
||||
Reference in New Issue
Block a user