gpt4 book ai didi

java - 如何形成http请求体的protobuf资源部分,并通过dhc客户端或 postman 进行测试以实现restful服务

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:13:57 27 4
gpt4 key购买 nike

我创建了一个 .proto 消息,我正在公开一个看起来像这样的休息服务

@Path("/test")
public interface test{

@POST
@Produces("application/x-protobuf")
@Consumes("application/x-protobuf")
public Response getProperties(TestRequest testrq);
}

现在 TestRequest 是 .protobuf 的 Java 生成文件,我如何在请求正文中传递它?

这将是 .proto 文件格式

message TestRequest
{
string id = 1;
string name = 2;
enum TestType
{
Test=1
}
TestType testType = 3;
}

最佳答案

Protoman如果您需要一个简单的 protobuf api 客户端,请尝试一下。

免责声明:这是我的副业

关于java - 如何形成http请求体的protobuf资源部分,并通过dhc客户端或 postman 进行测试以实现restful服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39314999/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com