MCPcopy Create free account
hub / github.com/apache/brpc / MakePostRequestMessage

Method MakePostRequestMessage

test/brpc_http_rpc_protocol_unittest.cpp:179–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177 }
178
179 brpc::policy::HttpContext* MakePostRequestMessage(const std::string& path) {
180 brpc::policy::HttpContext* msg = new brpc::policy::HttpContext(false);
181 msg->header().uri().set_path(path);
182 msg->header().set_content_type("application/json");
183 msg->header().set_method(brpc::HTTP_METHOD_POST);
184
185 test::EchoRequest req;
186 req.set_message(EXP_REQUEST);
187 butil::IOBufAsZeroCopyOutputStream req_stream(&msg->body());
188 EXPECT_TRUE(json2pb::ProtoMessageToJson(req, &req_stream, NULL));
189 return msg;
190 }
191
192 brpc::policy::HttpContext* MakePostProtoJsonRequestMessage(const std::string& path) {
193 brpc::policy::HttpContext* msg = new brpc::policy::HttpContext(false);

Callers

nothing calls this directly

Calls 4

set_pathMethod · 0.80
set_content_typeMethod · 0.80
ProtoMessageToJsonFunction · 0.50
set_methodMethod · 0.45

Tested by

no test coverage detected