Describe the bug
When adding a header with a null value, an exception is thrown when sending the request and requires looking at the call stack to infer the cause of the exception.
I think this could be made clearer by throwing the exception when adding the header, or returning a more detailed message in the later thrown exception.
To Reproduce
var client = new RestClient("baseUrl");
var request = new RestRequest("endpoint");
request.AddJsonBody(model);
request.AddHeader("X-SomeHeader", null);
var response = client.ExecutePost(request);
Expected behavior
Either an exception is thrown on the AddHeader() call, or a more detailed exception message is returned when calling ExecutePost()
Describe the bug When adding a header with a null value, an exception is thrown when sending the request and requires looking at the call stack to infer the cause of the exception. I think this could be made clearer by throwing the exception when adding the header, or returning a more detailed message in the later thrown exception.
To Reproduce
Expected behavior Either an exception is thrown on the AddHeader() call, or a more detailed exception message is returned when calling ExecutePost()
Stack trace
Desktop (please complete the following information):