简体   繁体   中英

Does .Net Core 2.1 support HTTP/2 requests?

I am working to gRPC in my .Net Core 2.1 application, But when i send a request the server throws an error stating

Connection id "" bad request data: "Unrecognized HTTP version: 'HTTP/2.0'

  • Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Unrecognized HTTP version: 'HTTP/2.0'
  • Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser`1.RejectUnknownVersion(Byte* version, Int32 length)
  • Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser`1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length)
  • Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser 1.ParseRequestLine(TRequestHandler handler, ReadOnlySequence 1& buffer, SequencePosition& consumed, SequencePosition&

请在此处查看文档以在 kestrel 中启用 http/2: https ://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-2.2#http2-support

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM