首页 > 解决方案 > io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception:意外的 HTTP/1.x 请求:GET 请求

问题描述

我收到带有 curl 命令的意外 HTTP/1.x 请求(版本 7.77.0) curl -k -v --http2 http://localhost:9090/v1/grpc/hello 请求

HTTP/2 客户端前言字符串丢失或损坏。curl -k -v --http2 https://localhost:9090/v1/grpc/hello 请求上接收到的字节的十六进制转储

https://github.com/konzerntech/grpcsample/issues/1

我正在使用 Spring Boot GRPC 应用程序,尝试从 curl 获取 GET HTTP 请求

下面是我的原始文件服务方法


service PingPongService {
    rpc ping(PingRequest) returns (PongResponse) {
    
    option (google.api.http) = { get: "/v1/grpc/{ping}" };
    }
}

我的意图是通过 json 请求访问 grpc 存根方法。整个代码的任何帮助都在 git hub 中共享。

标签: javaspring-bootprotocol-buffersgrpchttp2

解决方案


推荐阅读