Exemple #1
0
        private void AddHeader(HttpRequestMessage requestMessage, RestHeader header)
        {
            switch (header.Key)
            {
            case "Authorization":
                requestMessage.Headers.Authorization = AuthenticationHeaderValue.Parse(header.Value);
                break;

            case "Date":
                requestMessage.Headers.Date = DateTimeOffset.Parse(header.Value);
                break;

            case "Content-Type":
                break;

            default:
                requestMessage.Headers.Add(header.Key, header.Value);
                break;
            }
        }
Exemple #2
0
 public void AddDefaultHeader(RestHeader restHeader)
 {
     _defaultHeaders.Add(restHeader);
 }