Amido.Testing.Http.RestClient.AddHeader C# (CSharp) Method

AddHeader() public method

Add a header to the request.
public AddHeader ( string key, string value ) : IRestClient
key string The key of the header.
value string The value of the header.
return IRestClient
        public virtual IRestClient AddHeader(string key, string value)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(key), "The key cannot be null or empty.");
            Contract.Requires(!string.IsNullOrWhiteSpace(value), "The value cannot be null or empty.");

            foreach (var httpRequestMessage in httpRequestMessageList)
            {
                httpRequestMessage.Headers.Add(key, value);
            }
            
            return this;
        }