| 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); |
nothing calls this directly
no test coverage detected