I'm trying to send custom HTTP Headers with a JsonServiceClient but headers are never sent in the query.
I'm using:
JsonServiceClient client = new JsonServiceClient (baseUri);
client.Headers.Add ("X-Parse-Application-Id", "XXXXXX");
client.Headers.Add ("X-Parse-REST-API-Key", "XXXXXX");
Any idea ?
You haven't made a request yet. The Headers get added here when you make a request.
An alternative way to add headers is to use the Request filters, e.g:
client.RequestFilter = httpReq => {
httpReq.Headers.Add ("X-Parse-Application-Id", "XXXXXX");
httpReq.Headers.Add ("X-Parse-REST-API-Key", "XXXXXX");
};
Which effectively does the same thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With