FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openapi/examples/cpp/http_client/main.cpp at main · noneback/openapi · GitHub
noneback
/
openapi
Public
forked from
longbridge/openapi
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openapi
/
examples
/
cpp
/
http_client
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (34 loc) · 925 Bytes
Breadcrumbs
openapi
/
examples
/
cpp
/
http_client
/
main.cpp
Copy path
File metadata and controls
40 lines (34 loc) · 925 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
include
<
iostream
>
#
include
<
longport.hpp
>
#
ifdef
WIN32
#
include
<
windows.h
>
#
endif
using
namespace
longport
;
int
main
(
int
argc,
char
const
* argv[])
{
#
ifdef
WIN32
SetConsoleOutputCP
(
CP_UTF8
);
#
endif
HttpClient http_cli;
Status status = http_cli.
from_env
();
if
(!status) {
std::cout <<
"
failed to load configuration from environment:
"
<< status.
message
() << std::endl;
return
-
1
;
}
http_cli.
request
(
"
get
"
,
"
/v1/trade/execution/today
"
,
std::
nullopt
,
std::
nullopt
,
[](
auto
res) {
if
(!res) {
std::cout <<
"
failed:
"
<< res.
status
().
message
()
<< std::endl;
return
;
}
std::cout << res->
response_body
<< std::endl;
});
std::cin.
get
();
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL