/// <summary> /// Throws exception when the sending request 2 event is registered and sending request event is fired /// </summary> /// <param name="sender">The context which is sending the request</param> /// <param name="args">The arguments for the request</param> internal void FailOnOldSendingRequestEvent(object sender, SendingRequestEventArgs args) { throw new TaupoInvalidOperationException("Sending Request Event should not fire as Sending Request 2 Event is already registered"); }
// Currently SendingRequest2/SendingRequest2EventArgs is not supported in Phone private void InjectAuthenticationCookies(object sender, SendingRequestEventArgs e) { if (this.authenticationHeaders != null) { foreach (var header in this.authenticationHeaders) { e.RequestHeaders[header.Key] = header.Value; } } }
/// <summary> /// Fires the SendingRequest event. /// </summary> /// <param name="eventArgs">SendingRequestEventArgs instance containing all information about the request.</param> internal void FireSendingRequest(SendingRequestEventArgs eventArgs) { #if DEBUG Version requestVersion = GetRequestVersion(eventArgs.RequestHeaders); Debug.Assert(this.UserModifiedRequestInBuildingRequest || requestVersion == null || requestVersion <= this.MaxProtocolVersionAsVersion, "requestVersion must not be greater than the maxProtocolVersion"); Debug.Assert(this.UserModifiedRequestInBuildingRequest || eventArgs.RequestHeaders[XmlConstants.HttpODataMaxVersion] == this.MaxProtocolVersionAsVersion.ToString(Util.ODataVersionFieldCount), "requestMDSV must be set to the maxProtocolVersion"); #endif this.Context.FireSendingRequest(eventArgs); }
static void RemoteClient_SendingRequest(object sender, SendingRequestEventArgs e) { DataSent += "\r\n" + e.Request.RequestUri.AbsoluteUri; }