Output interceptor
httpListener and webSocketListener allows to intercept outgoing messages via output$
attribute. Using HttpOutputEffect
or WsOutputEffect
you can grab an outgoing HTTP/Event response and map it into another form of outgoing message. Using this kind of response interceptor you can modify certain type of responses on demand. For example, in case of Accept: application/vnd.api+json
you would like to adjust the response accordingly to fit the needs of JSON API specification.
HTTP:
HTTP output interceptor allows you to grab the initial request via EffectMetadata.initiator
. You can use it eg. for creating a compression middleware.
WebSockets:
Last updated