Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / HttpRequestMessageProperty.cs / 2 / HttpRequestMessageProperty.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System; using System.Net; using System.ServiceModel.Activation; using System.Collections.Specialized; public sealed class HttpRequestMessageProperty { WebHeaderCollection headers; string method; string queryString; bool suppressEntityBody; HttpListenerRequest listenerRequest; HostedRequestContainer hostedRequestContainer; internal HttpRequestMessageProperty(HttpListenerRequest listenerRequest) : this() { this.listenerRequest = listenerRequest; } internal HttpRequestMessageProperty(HostedRequestContainer hostedRequest) : this() { this.hostedRequestContainer = hostedRequest; } public HttpRequestMessageProperty() { this.method = "POST"; this.queryString = string.Empty; this.suppressEntityBody = false; } public static string Name { get { return "httpRequest"; } } public WebHeaderCollection Headers { get { if (this.headers == null) { this.headers = new WebHeaderCollection(); if (this.listenerRequest != null) { this.headers.Add(this.listenerRequest.Headers); // MB 57988 - System.Net strips off user-agent from the headers collection if (this.listenerRequest.UserAgent != null && this.headers[HttpRequestHeader.UserAgent] == null) { this.headers.Add(HttpRequestHeader.UserAgent, this.listenerRequest.UserAgent); } this.listenerRequest = null; } else if (this.hostedRequestContainer != null) { this.hostedRequestContainer.CopyHeaders(this.headers); this.hostedRequestContainer = null; } } return this.headers; } } public string Method { get { return this.method; } set { if (value == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value"); } this.method = value; } } public string QueryString { get { return this.queryString; } set { if (value == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value"); } this.queryString = value; } } public bool SuppressEntityBody { get { return this.suppressEntityBody; } set { this.suppressEntityBody = value; } } internal void MakeRequestContainerNull() { this.hostedRequestContainer = null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AlphabeticalEnumConverter.cs
- DocumentScope.cs
- XmlNodeChangedEventArgs.cs
- ActivityCodeDomSerializer.cs
- BitmapEffectDrawingContextState.cs
- EncodingDataItem.cs
- cookiecontainer.cs
- DecimalConverter.cs
- PluggableProtocol.cs
- DBAsyncResult.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- SharedRuntimeState.cs
- ListViewCommandEventArgs.cs
- IndexedWhereQueryOperator.cs
- PassportPrincipal.cs
- MoveSizeWinEventHandler.cs
- controlskin.cs
- KeyInterop.cs
- HwndHostAutomationPeer.cs
- SafeLocalMemHandle.cs
- MouseWheelEventArgs.cs
- ListViewContainer.cs
- SystemWebSectionGroup.cs
- CommandBinding.cs
- shaperfactoryquerycacheentry.cs
- UIPropertyMetadata.cs
- HeaderedContentControl.cs
- DrawingImage.cs
- SequenceDesignerAccessibleObject.cs
- DtcInterfaces.cs
- HttpListenerContext.cs
- SimpleFieldTemplateFactory.cs
- CodeTypeDeclarationCollection.cs
- StrokeNodeData.cs
- XPathQilFactory.cs
- DynamicField.cs
- TablePatternIdentifiers.cs
- RoleGroup.cs
- TransformValueSerializer.cs
- ObjectViewListener.cs
- TemplateBamlRecordReader.cs
- AssemblyCollection.cs
- MissingMemberException.cs
- SQLByte.cs
- QueueException.cs
- ViewBox.cs
- XmlTypeMapping.cs
- AppDomainProtocolHandler.cs
- DataGridViewTextBoxEditingControl.cs
- StringUtil.cs
- FixedSOMGroup.cs
- FileLoadException.cs
- HtmlSelect.cs
- UniqueEventHelper.cs
- HTMLTagNameToTypeMapper.cs
- SqlDataReader.cs
- Image.cs
- TextEffect.cs
- XmlDataImplementation.cs
- ResourceReader.cs
- PageTheme.cs
- DoWorkEventArgs.cs
- Matrix3DStack.cs
- AnnotationObservableCollection.cs
- BindingContext.cs
- ForEachAction.cs
- IntegerValidatorAttribute.cs
- ConfigUtil.cs
- ExcCanonicalXml.cs
- AuditLevel.cs
- ResourceWriter.cs
- ComponentResourceKeyConverter.cs
- DoubleCollectionConverter.cs
- WeakKeyDictionary.cs
- CallbackTimeoutsBehavior.cs
- XmlMembersMapping.cs
- HttpHeaderCollection.cs
- AlphabeticalEnumConverter.cs
- ParameterCollectionEditorForm.cs
- HierarchicalDataSourceConverter.cs
- Attribute.cs
- TextTreeDeleteContentUndoUnit.cs
- FollowerQueueCreator.cs
- ObsoleteAttribute.cs
- GridViewRow.cs
- ViewLoader.cs
- TrustLevel.cs
- InputDevice.cs
- DBSchemaRow.cs
- ResourceContainer.cs
- Pen.cs
- MessageHeaderDescription.cs
- Decimal.cs
- SqlTrackingQuery.cs
- StreamSecurityUpgradeAcceptorBase.cs
- EventManager.cs
- TextDecorationLocationValidation.cs
- Odbc32.cs
- DictionarySectionHandler.cs
- MetafileHeaderWmf.cs