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}"); }
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"); } }
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); }
private void InsertXAnchorMailboxHeader(object sender, Microsoft.OData.Client.SendingRequest2EventArgs e, string email) { e.RequestMessage.SetHeader("X-AnchorMailbox", email); }