mirror of
https://github.com/qicosmos/rest_rpc.git
synced 2026-08-29 16:40:48 +08:00
add another example
This commit is contained in:
@@ -69,7 +69,22 @@ void test_get_person_name() {
|
||||
}
|
||||
}
|
||||
|
||||
void test_get_person() {
|
||||
try {
|
||||
boost::asio::io_service io_service;
|
||||
test_client client(io_service);
|
||||
client.connect("127.0.0.1", "9000");
|
||||
|
||||
auto result = client.call<person>("get_person");
|
||||
std::cout << result.name << std::endl;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
test_get_person();
|
||||
test_get_person_name();
|
||||
test_hello();
|
||||
test_add();
|
||||
|
||||
Reference in New Issue
Block a user