tags:

views:

36

answers:

1

I want 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?

A: 

ResourceSpace.Has.ResourcesOfType().WithoutUri.TranscodedBy().ForContentType("application/json")

That should do it

serialseb
I'm not seeing a ForContentType extension method anywhere. There is a ForMediaType extension, however, but this: ResourceSpace.Has.ResourcesOfType<T>(). WithoutUri. AsJson(). //custom for the codec ForMediaType("application/json");Still returns a 406.
Eric Hauser
markdown ate the angle brackets. ResourcesOfType<object>() is the one you want, and the method is indeed ForMediaType :)
serialseb