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
15
15
16
16
## link libs
17
17
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 )
20
20
21
21
target_link_libraries (${project_name} -lib
22
22
PUBLIC oatpp::oatpp
Original file line number Diff line number Diff line change 21
21
#include < iostream>
22
22
23
23
std::shared_ptr<oatpp::web::client::RequestExecutor> createOatppExecutor () {
24
+ OATPP_LOGD (" App" , " Using Oat++ native HttpRequestExecutor." );
24
25
auto connectionProvider = oatpp::network::client::SimpleTCPConnectionProvider::createShared (" httpbin.org" , 80 );
25
26
return oatpp::web::client::HttpRequestExecutor::createShared (connectionProvider);
26
27
}
27
28
28
29
std::shared_ptr<oatpp::web::client::RequestExecutor> createCurlExecutor () {
30
+ OATPP_LOGD (" App" , " Using oatpp-curl RequestExecutor." );
29
31
return oatpp::curl::RequestExecutor::createShared (" http://httpbin.org/" , false /* set verbose=true for dubug info */ );
30
32
}
31
33
@@ -35,8 +37,8 @@ void run(){
35
37
auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared ();
36
38
37
39
/* 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
40
42
41
43
/* DemoApiClient uses DemoRequestExecutor and json::mapping::ObjectMapper */
42
44
/* ObjectMapper passed here is used for serialization of outgoing DTOs */
You can’t perform that action at this time.
0 commit comments