代码之家  ›  专栏  ›  技术社区  ›  sillydong

如何包装http。请求到proto文件

  •  0
  • sillydong  · 技术社区  · 7 年前

    我需要包装一个http。请求到proto文件中,以便我可以从客户端向服务器端发送请求实例,如下代码所示:

    message WrapRequest{
      *http.Request request = 1; // this is wrong
      int64 start = 2;
      int64 stop = 3;
      bool match = 4;
      string ruleid = 5;
    }
    

    我确信我的代码中的请求行是错误的,是否有人知道如何实现它。谢谢。

    1 回复  |  直到 7 年前
        1
  •  2
  •   newbie master    7 年前

    你宁愿通过 http.Request http.Request.Body http.Request.Header 取决于您在服务器上使用什么。