Skip to content

Commit

Permalink
check the request url.
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Aug 5, 2019
1 parent 3d5355f commit 478decb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/cinatra/client_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ namespace cinatra {

template<res_content_type CONTENT_TYPE = res_content_type::json, size_t TIMEOUT = 3000, http_method METHOD = POST>
inline std::string send_msg(std::string ip, std::string api, std::string msg) {
assert(!api.empty() && api[0] == '/');
auto client = client_factory::instance().new_client(std::move(ip), "http");
return client->send_msg<CONTENT_TYPE>(std::move(api), std::move(msg));
}

template<res_content_type CONTENT_TYPE = res_content_type::json, size_t TIMEOUT = 3000, http_method METHOD = POST>
inline std::string send_msg(std::string ip, std::string port, std::string api, std::string msg) {
assert(!api.empty() && api[0] == '/');
auto client = client_factory::instance().new_client(std::move(ip), std::move(port));
return client->send_msg<CONTENT_TYPE>(std::move(api), std::move(msg));
}
Expand Down

0 comments on commit 478decb

Please sign in to comment.