33#include < tchar.h>
44#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
55#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
6- #pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp ")
6+ #pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient ")
77#pragma comment(lib,"Ws2_32")
88#endif
99#include < stdio.h>
1616#include < XEngine_Include/XEngine_ProtocolHdr.h>
1717#include < XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1818#include < XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
19- #include < XEngine_Include/XEngine_NetHelp/APIHelp_Define .h>
20- #include < XEngine_Include/XEngine_NetHelp/APIHelp_Error .h>
19+ #include < XEngine_Include/XEngine_NetHelp/APIClient_Define .h>
20+ #include < XEngine_Include/XEngine_NetHelp/APIClient_Error .h>
2121using namespace std ;
2222
23- // g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
23+ // g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
2424// 需要优先配置XEngine
2525// WINDOWS使用VS2022 x86 debug 编译
2626// linux使用下面的命令编译
27- // g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -ljsoncpp
27+ // g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp
2828
2929// 查询
3030void API_Manage_Query ()
@@ -38,9 +38,9 @@ void API_Manage_Query()
3838 st_JsonRoot[" lpszTimeEnd" ];
3939 st_JsonRoot[" lpszBuckKey" ] = " storagekey2" ;
4040
41- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
41+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
4242 {
43- printf (" API_Manage_Query:%lX\n " , APIHelp_GetLastError ());
43+ printf (" API_Manage_Query:%lX\n " , APIClient_GetLastError ());
4444 return ;
4545 }
4646 printf (" API_Manage_Query:%d,%s\n " , nCode, ptszMsgBuffer);
@@ -66,9 +66,9 @@ void API_Manage_Insert()
6666 st_JsonRoot[" List" ] = st_JsonArray;
6767 st_JsonRoot[" Count" ] = 1 ;
6868
69- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
69+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
7070 {
71- printf (" API_Manage_Insert:%lX\n " , APIHelp_GetLastError ());
71+ printf (" API_Manage_Insert:%lX\n " , APIClient_GetLastError ());
7272 return ;
7373 }
7474 printf (" API_Manage_Insert:%d,%s\n " , nCode, ptszMsgBuffer);
@@ -91,9 +91,9 @@ void API_Manage_Delete()
9191 st_JsonRoot[" List" ] = st_JsonArray;
9292 st_JsonRoot[" Count" ] = 1 ;
9393
94- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
94+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
9595 {
96- printf (" API_Manage_Delete:%lX\n " , APIHelp_GetLastError ());
96+ printf (" API_Manage_Delete:%lX\n " , APIClient_GetLastError ());
9797 return ;
9898 }
9999 printf (" API_Manage_Delete:%d,%s\n " , nCode, ptszMsgBuffer);
@@ -111,9 +111,9 @@ void API_Manage_Dir()
111111 st_JsonRoot[" lpszBuckKey" ] = " storagekey1" ;
112112 st_JsonRoot[" lpszUserDir" ] = " user" ;
113113 st_JsonRoot[" nOPerator" ] = 1 ;
114- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
114+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
115115 {
116- printf (" API_Manage_Dir:%lX\n " , APIHelp_GetLastError ());
116+ printf (" API_Manage_Dir:%lX\n " , APIClient_GetLastError ());
117117 return ;
118118 }
119119 printf (" API_Manage_Dir:%d,%s\n " , nCode, ptszMsgBuffer);
@@ -123,9 +123,9 @@ void API_Manage_Dir()
123123 st_JsonRoot[" lpszBuckKey" ] = " storagekey1" ;
124124 st_JsonRoot[" lpszUserDir" ];
125125 st_JsonRoot[" nOPerator" ] = 0 ;
126- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
126+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
127127 {
128- printf (" API_Manage_Dir:%lX\n " , APIHelp_GetLastError ());
128+ printf (" API_Manage_Dir:%lX\n " , APIClient_GetLastError ());
129129 return ;
130130 }
131131 printf (" API_Manage_Dir:%d,%s\n " , nCode, ptszMsgBuffer);
@@ -135,9 +135,9 @@ void API_Manage_Dir()
135135 st_JsonRoot[" lpszBuckKey" ] = " storagekey1" ;
136136 st_JsonRoot[" lpszUserDir" ] = " user" ;
137137 st_JsonRoot[" nOPerator" ] = 2 ;
138- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
138+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, st_JsonRoot.toStyledString ().c_str (), &nCode, &ptszMsgBuffer, &nLen))
139139 {
140- printf (" API_Manage_Dir:%lX\n " , APIHelp_GetLastError ());
140+ printf (" API_Manage_Dir:%lX\n " , APIClient_GetLastError ());
141141 return ;
142142 }
143143 printf (" API_Manage_Dir:%d,%s\n " , nCode, ptszMsgBuffer);
@@ -150,9 +150,9 @@ void API_Manage_Task()
150150 int nLen = 0 ;
151151 int nCode = 0 ;
152152 TCHAR* ptszMsgBuffer = NULL ;
153- if (!APIHelp_HttpRequest_Custom (_T (" POST" ), lpszUrl, NULL , &nCode, &ptszMsgBuffer, &nLen))
153+ if (!APIClient_Http_Request (_T (" POST" ), lpszUrl, NULL , &nCode, &ptszMsgBuffer, &nLen))
154154 {
155- printf (" API_Manage_Task:%lX\n " , APIHelp_GetLastError ());
155+ printf (" API_Manage_Task:%lX\n " , APIClient_GetLastError ());
156156 return ;
157157 }
158158 printf (" API_Manage_Task:%d,%s\n " , nCode, ptszMsgBuffer);
0 commit comments