-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
Our API requires that customers send vnd mime types in both the Accept and Content-Type headers.
With the C# example, the following code is provided:
var client = new RestClient("https://api.whispir.com/messages?apikey=REPLACE_ME");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/vnd.whispir.message-v1+json");
request.AddHeader("accept", "application/vnd.whispir.message-v1+json");
request.AddHeader("authorization", "<REPLACE_ME>");
request.AddParameter("application/vnd.whispir.message-v1+json", "{\"to\":\"<REPLACE_ME>\",\"subject\":\"<REPLACE_ME>\",\"body\":\"<REPLACE_ME>\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
The problem though is that the request.AddHeader method is not respected unless the following code is provided on line 2:
client.ClearHandlers();
This code clears the default handlers allowing the user to set custom headers.
Can you please include this in your out of the box rendering of C# code.