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
2010-08-17 07:54:48
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
2010-08-17 13:29:56
markdown ate the angle brackets. ResourcesOfType<object>() is the one you want, and the method is indeed ForMediaType :)
serialseb
2010-08-23 21:30:32