GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.servicestack.net — Access HTTP-specific Features in Services Access HTTP-specific Features in ServicesServiceStack is based on http handlers, but ServiceStack provides a clean, dependency-free IService to implement your Web Services logic in. The philosophy behind this approach is that the less dependencies you have on your environment and its request context, the more testable and re-usable your services become. Request FiltersThe Request Filters are applied before the service gets called and accepts: (IRequest, IResponse, RequestDto) e.g:
ServicesWhen inheriting from Service you can access them via
Response FiltersThe Response Filters are applied after your service is called and accepts: (IRequest, IResponse, ResponseDto) e.g Add a response filter to add a 'Content-Disposition' header so browsers treat it as a native .csv file:
Communicating throughout the Request PipelineThe recommended way to pass additional metadata about the request is to use the
Advantages for having dependency-free servicesIf you don't need to access the HTTP specific features your services can be called by any non-HTTP endpoint, like from a message queue. Injecting the IRequest into your ServiceAlthough working in a clean-room can be ideal from re-usability and testability point of view, you stand the chance of missing out a lot of the features present in HTTP. Just like using built-in Funq IOC container, the way to tell ServiceStack to inject the request context is by implementing the IRequiresRequest interface which will get the IRequest injected before each request. INFO ServiceStack's Convenient INFO To return a customized HTTP Response, e.g. set Response Cookies or Headers, return the HttpResult object On This Page
|
| You are visitor 01402860 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |