我需要将 http.Request 包装到 proto 文件中,以便我可以从客户端向服务器端发送请求实例,如以下代码所示:
message WrapRequest{
*http.Request request = 1; // this is wrong
int64 start = 2;
int64 stop = 3;
bool match = 4;
string ruleid = 5;
}
我确定我代码中的请求行是错误的,有没有人知道如何实现它。非常感谢。
最佳答案
您可以不传递 http.Request
而传递 http.Request.Body
或 http.Request.Header
取决于做什么你在你的服务器上使用。
关于go - 如何将 http.Request 包装到 proto 文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47916534/