MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / AsyncRequest

Method AsyncRequest

src/plugin/net/src/AFCHttpClientModule.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38ananas::Future<std::pair<bool, std::string>> AFCHttpClientModule::AsyncRequest(
39 brynet::net::http::HttpRequest::HTTP_METHOD http_method, const std::string& ip, const uint16_t port,
40 const std::string& url, std::map<std::string, std::string>& params, const std::vector<std::string>& cookies,
41 const google::protobuf::Message& http_msg)
42{
43 ananas::Promise<std::pair<bool, std::string>> promise;
44
45 std::string http_body;
46 auto status = google::protobuf::util::MessageToJsonString(http_msg, &http_body);
47 if (!status.ok())
48 {
49 promise.SetValue(std::make_pair(false, std::string()));
50 return promise.GetFuture();
51 }
52
53 return http_client_->AsyncRequest(http_method, ip, port, url, params, cookies, http_body);
54}
55
56ananas::Future<std::pair<bool, std::string>> AFCHttpClientModule::AsyncRequest(
57 brynet::net::http::HttpRequest::HTTP_METHOD http_method, const std::string& ip, const uint16_t port,

Callers

nothing calls this directly

Calls 3

okMethod · 0.80
GetFutureMethod · 0.80
SetValueMethod · 0.45

Tested by

no test coverage detected