File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ add_library(${project_name}-lib
1515
1616## link libs
1717
18- find_package (oatpp 0.19.11 REQUIRED)
19- find_package (oatpp-curl 0.19.11 REQUIRED)
18+ find_package (oatpp 0.19.12 REQUIRED)
19+ find_package (oatpp-curl 0.19.12 REQUIRED)
2020
2121target_link_libraries (${project_name} -lib
2222 PUBLIC oatpp::oatpp
Original file line number Diff line number Diff line change 2121#include < iostream>
2222
2323std::shared_ptr<oatpp::web::client::RequestExecutor> createOatppExecutor () {
24+ OATPP_LOGD (" App" , " Using Oat++ native HttpRequestExecutor." );
2425 auto connectionProvider = oatpp::network::client::SimpleTCPConnectionProvider::createShared (" httpbin.org" , 80 );
2526 return oatpp::web::client::HttpRequestExecutor::createShared (connectionProvider);
2627}
2728
2829std::shared_ptr<oatpp::web::client::RequestExecutor> createCurlExecutor () {
30+ OATPP_LOGD (" App" , " Using oatpp-curl RequestExecutor." );
2931 return oatpp::curl::RequestExecutor::createShared (" http://httpbin.org/" , false /* set verbose=true for dubug info */ );
3032}
3133
@@ -35,8 +37,8 @@ void run(){
3537 auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared ();
3638
3739 /* Create RequestExecutor which will execute ApiClient's requests */
38- auto requestExecutor = createOatppExecutor ();
39- // auto requestExecutor = createCurlExecutor();
40+ auto requestExecutor = createOatppExecutor (); // <-- Always use oatpp native executor where's possible.
41+ // auto requestExecutor = createCurlExecutor(); // <-- Curl request executor
4042
4143 /* DemoApiClient uses DemoRequestExecutor and json::mapping::ObjectMapper */
4244 /* ObjectMapper passed here is used for serialization of outgoing DTOs */
You can’t perform that action at this time.
0 commit comments