I would like to add one custom header to all the outgoing POST calls sent by the typescript JsonServiceClient.
I’m using the requetFilter
, this is the code
constructor() {
this.sseClient = new ServerEventsClient(this.endPoint, this.channels, {
onException: this.onException
});
this.sseClient.serviceClient.requestFilter = AppServerEventsService.filtroRichieste;
}
static filtroRichieste(req: IRequestInit)
{
let headers = new Headers(req.headers);
headers.set('X-Tag', 'my-tag');
req.headers = headers;
}
it works only for the /json/reply/UpdateEventSubscriber POST not for the event-heartbeat calls and I don’t why.
Any suggestions?
I’m using
"@servicestack/client": "^1.0.31",
Thanks