我正在使用嵌入式Nancy网络服务器,我使用Nu-Get为内置协议缓冲区序列化安装适当的插件(Nancy.Serialization.ProtoBuf和protobuf-net)。
但是,仅仅存在这些软件包似乎并没有为我启用协议缓冲区。我正在发送一个带有application / x-protobuf的Accepts头的请求。使用Nancy诊断页面(内置)我可以跟踪我的请求并查看:
response Headers
status Code
406
log
New Request Started
[DefaultResponseNegotiator] Processing as negotiation
[DefaultResponseNegotiator] Original accept header: application/x-protobuf;q=1
[DefaultResponseNegotiator] Coerced accept header: application/x-protobuf
[DefaultResponseNegotiator] Acceptable media ranges: */*
[DefaultResponseNegotiator] Unable to negotiate response - no headers compatible
因此它似乎无法处理协议缓冲区。当我检查诊断站点的主页时:
response Processors
Nancy.Responses.Negotiation.JsonProcessor
Nancy.Responses.Negotiation.ResponseProcessor
Nancy.Responses.Negotiation.ViewProcessor
Nancy.Responses.Negotiation.XmlProcessor
似乎只有默认的响应处理器。 Protobuf未列出。
有关如何让插件注册Nancy的任何指示?