示例#1
0
        private static void Container_SendingRequest2(object sender, Microsoft.OData.Client.SendingRequest2EventArgs e)
        {
            string userName = "******", password = "******";
            string token = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", userName, password)));

            e.RequestMessage.SetHeader("Authorization", $"Basic {token}");
        }
示例#2
0
        private static void Container_SendingRequest2(object sender, Microsoft.OData.Client.SendingRequest2EventArgs e)
        {
            IODataRequestMessage requestMessage = (IODataRequestMessage)e.RequestMessage;

            if (requestMessage != null)
            {
                requestMessage.SetHeader("MinDataServiceVersion", "3.0");
            }
        }
示例#3
0
        private void Context_SendingRequest2(object sender, Microsoft.OData.Client.SendingRequest2EventArgs e)
        {
            string svcCredentials = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(_username + ":" + _password));

            e.RequestMessage.SetHeader("Authorization", "Basic " + svcCredentials);
        }
示例#4
0
 private void InsertXAnchorMailboxHeader(object sender, Microsoft.OData.Client.SendingRequest2EventArgs e, string email)
 {
     e.RequestMessage.SetHeader("X-AnchorMailbox", email);
 }