开发者

OpenRasta Default Codec

开发者 https://www.devze.com 2023-01-11 16:51 出处:网络
I wan开发者_开发百科t to set a default codec in OpenRasta for all requests. i.e. When no other codec has been found using other methods, I want to use a custom JSON codec as the default.How do you wir

I wan开发者_开发百科t to set a default codec in OpenRasta for all requests. i.e. When no other codec has been found using other methods, I want to use a custom JSON codec as the default. How do you wire this up in the pipeline?


ResourceSpace.Has.ResourcesOfType<object>()
                 .WithoutUri
                 .TranscodedBy<MyCustomCodec>()
                 .ForMediaType("application/json");

That should do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消